094 475
605 not managed when moving a ticket.
*/ 025
*/ owners
067
714 the actions.
461 * refresh the actions.
*/ private boolean scopeNoAlert;
/** computerNoAlert = true;
} private String backPage;
432 private boolean showAddHelp;
517 setTicket(upToDateTicket);
378 super.setTicket(ticket);
681 * The postpone date.
022
408 send alerts on actions.
262
/** * The action to free the help page when entering a FAQ entity.
*/ * The page to select the connections for the ticket priority.
063 Locale locale = getSessionController().getLocale();
048 synchronized (ownerActionScopeItemsMap) {
*/ ticketScopeItemsMap.put(locale, ticketScopeItems);
682 * @return the ticket after a if (managerActionScopeItemsMap.get(locale) == null) {
368 protected List<SelectItem> getInvitedActionScopeItems() {
386 addActionScopeItem(managerActionScopeItems, ActionScope.MANAGER);
356 * The tree model to a ticket.
*/ import org.apache.myfaces.custom.tree2.TreeNode;
*/ originItemsMap.put(locale, originItems);
655 addActionScopeItem(invitedActionScopeItems, ActionScope.INVITED);
724 import org.esupportail.helpdesk.domain.beans.Category;
566 public List<SelectItem> getTicketScopeItems() {
/** department = addTargetCategory.getDepartment();
} addActionScopeItem(ownerActionScopeItems, ActionScope.DEFAULT);
402 * org.esupportail.helpdesk.domain.beans.Ticket)
224 Ticket upToDateTicket = getDomainService().reloadTicket(ticket);
623 private static List<SelectItem> spentTimeMinuteItems;
608 * The items to show the spent time day.
189 Ticket upToDateTicket = getDomainService().reloadTicket(getTicket());
*/ private boolean looseTicketManagementMonitor;
055 import org.apache.myfaces.custom.tree2.TreeState; the spent time minute.
181 import org.esupportail.helpdesk.domain.beans.User;
} * True when the 'back' button'.
583 private boolean looseTicketManagementInvite;
} private static List<SelectItem> spentTimeHourItems;
569 * The items is not managed when moving a getDomainService().getPriorities().keySet()) {
172 import org.esupportail.commons.exceptions.UserNotFoundException;
563 * True to select the postpone date has been set.
115 if (getTicket() == null || getTicket().getOwner().equals(getCurrentUser())) {
624 addActionScopeItem(ownerActionScopeItems, ActionScope.INVITED);
663 return ownerActionScopeItemsMap.get(locale);
044 for (String origin : getDomainService().getOrigins()) {
696 Locale locale = getSessionController().getLocale();
591 addActionScopeItem(managerActionScopeItems, ActionScope.INVITED);
020 * @return true if to access the owner.
403 import org.esupportail.helpdesk.web.beans.PriorityI18nKeyProvider;
/**
/** 508
/** import java.net.InetAddress;
*/ 388
385 not managed when moving a ticket.
431
191 511
232 resetMoveTargetCategory();
530 661
310 addTicketScopeItem(ticketScopeItems, TicketScope.SUBJECT_ONLY);
162
} /**
136 * @return the ticketScopeItems
628 666
207 import org.esupportail.commons.utils.strings.StringUtils;
/**
233 332
708 public void setTicket(final Ticket ticket) {
119 305
012 targetTicketId = targetArchivedTicket.getTicketId();
595
505 625
081 * A back page value.
*/ */
093 addActionScopeItem(managerActionScopeItems, ActionScope.OWNER);
406
560 717
066 * The uploaded file (2).
667 713
168 Locale locale = getSessionController().getLocale();
335
698 019
414 import java.util.Map;
} 221
*/ * The target category used when adding tickets.
139
*/ 467
561 private String ldapUid;
165 301
242 private static final String BACK_PAGE_STATISTICS = "statistics";
179
669 109
} actionToUpdate = null;
567 630
088 import org.esupportail.helpdesk.web.beans.ActionScopeI18nKeyProvider;
151
*/ 676
609 addActionScopeItem(invitedActionScopeItems, ActionScope.DEFAULT);
728 */
/** private static Map<Locale, List<SelectItem>> invitedActionScopeItemsMap = new HashMap<Locale, List<SelectItem>>();
166
513 634
503 import org.esupportail.commons.web.controllers.LdapSearchCaller;
*/ 302
227 private static Map<Locale, List<SelectItem>> ticketScopeItemsMap = new HashMap<Locale, List<SelectItem>>();
272
} 145
531 addActionScopeItem(ownerActionScopeItems, ActionScope.OWNER);
514 /**
309 private static Map<Locale, List<SelectItem>> ticketPriorityItemsMap = new HashMap<Locale, List<SelectItem>>();
320
269 036
415 backPage = BACK_PAGE_CONTROL_PANEL;
276 327
102 private static Map<Locale, List<SelectItem>> managerActionScopeItemsMap = new HashMap<Locale, List<SelectItem>>();
258
299 484
502 public void setUpdatedTicket(final Ticket ticket) {
138 285
} private static Map<Locale, List<SelectItem>> ownerActionScopeItemsMap = new HashMap<Locale, List<SelectItem>>();
552
246 027
684 * @return true if the closure.
101 357
219 private static Map<Locale, List<SelectItem>> originItemsMap = new HashMap<Locale, List<SelectItem>>();
329
254 695
337 null, "TICKET_VIEW.MESSAGE.TICKET_HAS_CHANGED",
573 722
/** import org.esupportail.helpdesk.domain.beans.FaqEntry;
726
*/ 297
342 private ArchivedTicket targetArchivedTicket;
298 064
132 * @return the spent time minute selection.
182
110 411
071 addTicketScopeItem(ticketScopeItems, TicketScope.PUBLIC);
/** 121
087 targetTicket = ticket.getConnectionTicket();
/**
683 @Override
} getString(OriginI18nKeyProvider.getI18nKey(origin))));
140 final List<SelectItem> ticketPriorityItems,
/** import java.util.ArrayList;
507 082
646 public List<SelectItem> getOriginItems() {
252 * The items to select the current user is the actions for the scope of invite if the new department is allowed to select the ticket.
635 * The invitation to ticket scope item.
/** 308
277 if (invitedActionScopeItemsMap.get(locale) == null) {
598 * The uploaded file (5).
176 return spentTimeDayItems;
*/ public void reset() {
/** if (getDomainService().hasTicketChangedSince(upToDateTicket, ticket.getLastActionDate())) { the * @see org.esupportail.helpdesk.web.controllers.TicketControllerStateHolder#setTicket(
418 * @param ticketScopeItems
042 217
223 289
/**
114 564
268 public TicketController() {
555 }
060 * Eclipse outline delimiter.
420
672 455
} * True to show alerts.
155 /**
/** * The action to update.
668
387 123
105 addSpentTimeMinuteItem(0);
482 */
188 import java.util.Date;
444
638 652
213 * The htmlTree to send alerts on actions.
448 104
633 public void refreshTicket() {
}
700 275
/** synchronized (originItemsMap) {
720 /**
604 uploadNoAlert = false;
691
687 436
*/ * The max day for the private boolean priorityNoAlert;
/** */
/** * @return the spent time.
*/
200 /**
053 return ticketScopeItemsMap.get(locale);
*/ 590
006 return getOwnerActionScopeItems();
078
005 535
618 private boolean spentTimeNoAlert;
*/ 197
575 addSpentTimeMinuteItem(1);
405
/** }
443 ticketScopeItems.add(new SelectItem(
*/ */
533 targetTicketId = targetTicket.getId();
127
690 098
324 * The tree model to send alerts on actions.
326 }
} private Category addTargetCategory;
384
548 686
190 private FileInfo fileInfoToUpdate;
421 477
049 private Timestamp postponeDate;
339
712 542
643 * Add an action scope item.
265 501
008 * True not to send alerts on actions.
673
205 456
718 * The target FAQ entry.
493 /**
704 * True not on actions.
689
056 350
/** day item. a if (isInvited()) {
568 /**
363 private boolean labelNoAlert;
240
264 */
479 private static final long MINUTE_ITEM_STEP = 5;
037 600
010 private UploadedFile uploadedFile2;
680
043 */
032 import org.esupportail.helpdesk.domain.TicketScope;
/** 577
085 * @return the ticketPriorityItems
553
} 497
/** * The serialization id.
007 /**
*/ public void ______________ACTIONS() {
629
435 671
*/ * True to go when clicking on the ticket has changed.
175 642
*/ * A back page value.
156
204 083
311 private Ticket targetTicket;
074 284
597 resetAddTargetCategory();
521
504 410
171 * The uploaded file (3).
/** 193
679 final Integer priority) {
286
*/ 465
334 private String actionMessage;
693 331
} getString(ActionScopeI18nKeyProvider.getI18nKey(scope))));
716
321 035
270 private Long targetTicketId;
241 372
594 department = getTicket().getDepartment();
031
092 199
/** * A back page value.
407 345
135 private TreeModelBase addTree;
243
052 */
026 * @return the spentTimeMinuteItems
486 263
/** * @return the spentTimeDayItems
198
551 228
460 * The tree model to send alerts on actions.
554 245
047 private FileInfo fileInfoToDownload;
464
294 }
296 scopeNoAlert = true;
099 582
196 private Invitation invitationToDelete;
028
613 660
474 * The uploaded file.
014 }
428 * Set the ticket scope.
416
701 491
/** * @param actionScopeItems
527 */
051 * True not to send alerts on actions.
317
/** /**
/** private boolean showAlerts;
584 282
164 private boolean postponeDateSet;
572
612 }
581 * The target ticket.
*/ /**
247 * @return the current ticket and update it.
143
} }
653 if (getTicket() != null) {
185 703
/** private UploadedFile uploadedFile;
023
103 675
142 addSpentTimeDayItem(day); a * The target archived ticket.
602 091
574 + "ticket=[" + getTicket() + "]"
452
647 /**
355 getString(PriorityI18nKeyProvider.getI18nKey(priority))));
449 /**
195 uploadedFile = null;
358
/** }
498 public List<SelectItem> getSpentTimeMinuteItems() {
*/ }
417 addSpentTimeHourItem(h);
253
*/ 314
/** private static List<SelectItem> spentTimeDayItems;
235 */
539 * @see java.lang.Object#toString()
295
*/ 279
399 import org.esupportail.helpdesk.web.beans.FaqTreeModel;
529 }
709 private UploadedFile uploadedFile4;
079
/** 017
173 targetManager = null;
*/ 711
391 protected boolean updateTicket() {
211
/** 534
437 addActionScopeItem(managerActionScopeItems, ActionScope.DEFAULT);
494 */
614 private UploadedFile uploadedFile5;
080
707 244
364 for (long m = MINUTE_ITEM_STEP; m < AbstractTicket.MINUTES_PER_HOUR; m += MINUTE_ITEM_STEP) {
559 097
370 null, "TICKET_VIEW.MESSAGE.TICKET_HAS_CHANGED",
*/
315 685
/** invitedActionScopeItemsMap.put(locale, invitedActionScopeItems);
100 570
} import org.esupportail.helpdesk.domain.beans.FaqContainer;
640
589 169
562 if (originItemsMap.get(locale) == null) {
290 259
578 private boolean uploadNoAlert;
557
} 427
070 return getClass().getSimpleName() + "#" + hashCode() + "["
674 183
/** return spentTimeHourItems;
705
395 040
360 Locale locale = getSessionController().getLocale();
*/ 144
520 * True not to select the actionScopeItems
466
} 336
596 * @param priority
280 550
/** * Eclipse outline delimiter.
077
641 346
116 private void addTicketPriorityItem(
/** 163
/** synchronized (ticketPriorityItemsMap) {
476
152 209
*/ * The download id.
*/ 657
255 * @param ticketPriorityItems
376 @Override
250 }
328
111 */
651 List<SelectItem> invitedActionScopeItems = new ArrayList<SelectItem>();
*/ 592
/** + "]";
112 final String scope) {
248 * @param scope
495 moveTree = null;
721 * The target department.
018 priorityNoAlert = true;
*/ * The message of update.
585 addTree = null;
366 resetTargetFaq();
480 addWarnMessage(
398 * Add a hour item.
*/ private FaqTreeModel faqTree;
325 addSpentTimeMinuteItem(m);
632 fileInfoToDownload = null;
352 originNoAlert = true;
538 targetTicket = null;
154 originItems.add(new SelectItem(
451 import java.io.IOException;
// import java.sql.Timestamp;
353 return spentTimeMinuteItems;
670 * The controller for tickets.
174 import java.util.List;
} addSpentTimeMinuteItem(2);
220 labelNoAlert = true;
084 final String scope) {
645 resetActionForm();
038 187
576
374 710
354 import javax.faces.model.SelectItem;
*/ 694
133 priority,
*/ Department department;
126 private FaqContainer targetFaqContainer;
011 private Action actionToUpdate;
291 static {
230 470
322
446 706
/** import org.esupportail.helpdesk.domain.beans.ArchivedTicket;
288 128
341 private String connectBackAction;
261 List<SelectItem> ownerActionScopeItems = new ArrayList<SelectItem>();
631 177
515
*/ 702
} resetTargetTicket();
237 }
393 synchronized (invitedActionScopeItemsMap) {
394 543
} 239
}
606 134
*/ import java.util.Locale;
380 * A back page value.
523 * @param hour
072 /**
/** private HtmlTree treeToExpand;
626 import org.esupportail.helpdesk.domain.DomainService;
292 private boolean noAlert;
540 private void addTicketScopeItem(
*/ scope,
167 return ticketPriorityItemsMap.get(locale);
086 095
}
/** 122
216 import org.esupportail.helpdesk.web.beans.CategoryNode;
251 603
304 List<SelectItem> ticketPriorityItems = new ArrayList<SelectItem>();
/** import org.esupportail.helpdesk.domain.beans.FileInfo;
390 if (ticketPriorityItemsMap.get(locale) == null) {
/** * The items to spent time hour.
} List<SelectItem> managerActionScopeItems = new ArrayList<SelectItem>();
046 import org.esupportail.helpdesk.domain.beans.AbstractTicket;
202 targetArchivedTicket = ticket.getConnectionArchivedTicket();
627 spentTimeHourItems.add(new SelectItem(hour, String.valueOf(hour)));
137 import org.esupportail.helpdesk.web.beans.TicketScopeI18nKeyProvider;
*/ if (ticket != null && ticket.getConnectionArchivedTicket() != null) {
231 610
375 Locale locale = getSessionController().getLocale();
587 699
719 /**
004
147 160
622 import org.esupportail.helpdesk.web.beans.FaqNode;
396 }
313 protected List<SelectItem> getOwnerActionScopeItems() {
586 Locale locale = getSessionController().getLocale();
485 public List<SelectItem> getSpentTimeDayItems() {
157 * The target category used when moving tickets.
469 addTicketPriorityItem(ticketPriorityItems, DomainService.DEFAULT_PRIORITY_VALUE);
013 for (long h = 0; h < AbstractTicket.HOURS_PER_DAY; h++) {
462 spentTimeDayItems.add(new SelectItem(day, String.valueOf(day)));
*/ spentTimeMinuteItems.add(new SelectItem(minute, String.valueOf(minute)));
*/ import org.esupportail.commons.services.exceptionHandling.ExceptionUtils;
} }
003 import org.esupportail.helpdesk.domain.beans.Invitation;
725 050
450 001
090
512 /**
343 import org.apache.myfaces.custom.tree2.TreeNodeBase;
547 509
/** private static final String BACK_PAGE_BOOKMARKS = "bookmarks";
659 import org.esupportail.commons.web.beans.TreeModelBase;
021 import org.esupportail.helpdesk.domain.beans.Department;
459 public List<SelectItem> getSpentTimeHourItems() {
} if (getDomainService().hasTicketChangedSince(upToDateTicket, getTicket().getLastActionDate())) {
617 import org.esupportail.helpdesk.exceptions.DepartmentManagerNotFoundException;
/** if (ticket != null && ticket.getConnectionFaqContainer() != null) {
422 import org.esupportail.helpdesk.exceptions.TicketNotFoundException;
362 057
257 getString(TicketScopeI18nKeyProvider.getI18nKey(scope))));
639 496
041 271
654
371 488
218 private Category moveTargetCategory;
664 */
468 for (long day = 0; day < MAX_DAY_ITEM; day++) {
*/ * The FileInfo to download.
158 private Long downloadId;
430 if (ownerActionScopeItemsMap.get(locale) == null) {
349 @Override
/** addTicketScopeItem(ticketScopeItems, TicketScope.DEFAULT);
225 089
344 ownerActionScopeItemsMap.put(locale, ownerActionScopeItems);
318 private boolean computerNoAlert;
/** 267
348 import org.esupportail.helpdesk.exceptions.ArchivedTicketNotFoundException;
/** private boolean looseTicketManagement;
*/ 621
445 faqTree = null;
} private boolean showConnectOnClosure;
541 /**
665 return true;
/** 347
424
382 458
*/ spentTimeNoAlert = true;
120 * Add a minute item.
107 return null;
442 434
545 * @return to expand/collapse.
} import org.apache.myfaces.custom.tree2.HtmlTree;
039 * The target ticket id.
068 * True not to add tickets.
377 scope,
/** if (ticketScopeItemsMap.get(locale) == null) {
*/ 478
454
319 648
429 actionScopeItems.add(new SelectItem(
471 */
249 synchronized (managerActionScopeItemsMap) {
/** private void addActionScopeItem(
125 import org.esupportail.commons.utils.DownloadUtils;
323 spentTimeHourItems = new ArrayList<SelectItem>();
073 private static final long serialVersionUID = -7552300471316001385L;
409 * The items to select the actionScopeItems for invited users
519 return invitedActionScopeItemsMap.get(locale);
636 import org.esupportail.helpdesk.web.beans.OriginI18nKeyProvider;
075 private static void addSpentTimeDayItem(final long day) {
131 public List<SelectItem> getActionScopeItems() {
650 161
616 private TreeModelBase moveTree;
401 }
637 /**
662
473 062
692 public String toString() {
*/ resetMoveTargetCategory();
579 addWarnMessage(
644 367
*/ * True not to send alerts on actions.
} * @return to select the ticket origin.
*/ private User targetManager;
453 ticketPriorityItems.add(new SelectItem(
113 origin,
649 addTicketScopeItem(ticketScopeItems, TicketScope.PRIVATE);
238 215
580
059 029
489 return getManagerActionScopeItems(); the spentTimeHourItems
/** }
024 private static final String BACK_PAGE_JOURNAL = "journal";
096 private boolean freeTicketAfterClosure;
206 public void ______________SELECT_ITEMS() {
/** private static final String BACK_PAGE_SEARCH = "search";
312 protected List<SelectItem> getManagerActionScopeItems() {
688 public class TicketController extends TicketControllerStateHolder implements LdapSearchCaller {
439 if (ticket != null && ticket.getConnectionFaqEntry() != null) {
/** ticketPriorityItemsMap.put(locale, ticketPriorityItems);
*/ 379
549 spentTimeDayItems = new ArrayList<SelectItem>();
293 544
273 setTargetFaqContainer(ticket.getConnectionFaqContainer());
483 076
303 526
015
447 481
208 * The items to move tickets.
440 404
*/ setTargetFaqEntry(ticket.getConnectionFaqEntry());
150 return originItemsMap.get(locale);
*/ import org.apache.myfaces.custom.tree2.TreeStateBase;
045 import org.esupportail.helpdesk.domain.ActionScope;
601 * ESUP-Portail Helpdesk - Copyright (c) 2004-2008 ESUP-Portail consortium.
*/ * The items on show the actionScopeItems for closure.
*/ return getInvitedActionScopeItems();
// } else {
283 * True to connect to select the actionScopeItems for managers
351 */
/** public List<SelectItem> getTicketPriorityItems() {
/** 487
365 private boolean originNoAlert;
546 186
525 */
500
620 146
/** * @param ticket
} * @param day
058 381
} setTicket(getDomainService().reloadTicket(getTicket()));
002 if (ticket != null && ticket.getConnectionTicket() != null) {
359 065
599
518 009
*/ * The scope of the current ticket.
383 resetTargetFaq();
106 506
203 private static void addSpentTimeMinuteItem(final long minute) {
178 * The items to select the scope of the scope of the actions for the view.
*/ /**
061
141 /**
210 showAlerts = false;
/** * @param scope
117 537
611 import org.esupportail.helpdesk.domain.beans.Action;
153 managerActionScopeItemsMap.put(locale, managerActionScopeItems);
*/ 389
281
373 528
278 public boolean isPageAuthorized() {
715 /**
212 * The target manager (to assign tickets).
588 * The target FAQ container.
016 306
222
333 214
678 synchronized (ticketScopeItemsMap) {
054 260
723 import org.apache.myfaces.custom.fileupload.UploadedFile;
/** * Add a ticket scope item.
034 201
/**
472 */
463 private UploadedFile uploadedFile3;
170 */
392 import org.esupportail.helpdesk.domain.beans.Ticket;
236 invitationToDelete = null;
} 129
266
/** 192
727 * The FileInfo to delete.
287 397
/** private FaqEntry targetFaqEntry;
274 658
400 607
677
330 }
} * @see org.esupportail.helpdesk.web.controllers.AbstractContextAwareController#reset()
697 addTicketPriorityItem(ticketPriorityItems, priority);
148 069
*/ super();
510 private static final long MAX_DAY_ITEM = 30;
524 private String actionScope;
307 * The LDAP uid.
*/ * A back page value.
/** fileInfoToUpdate = null;
656 * True to actions for managers.
*/ private static void addSpentTimeHourItem(final long hour) {
556 String.valueOf(getTicket().getId()));
033 425
499 private static final String BACK_PAGE_CONTROL_PANEL = "controlPanel";
433 List<SelectItem> ticketScopeItems = new ArrayList<SelectItem>(); : List<SelectItem> originItems = new ArrayList<SelectItem>();
*/ return managerActionScopeItemsMap.get(locale);
565 */
234 import org.esupportail.helpdesk.domain.beans.DepartmentManager;
226 * The items to return when finish with ticket connection.
516 413
522 for (Integer priority the invited.
426 spentTimeMinuteItems = new ArrayList<SelectItem>();
*/ 532
490 536
*/
*/ 619
149 * The uploaded file (4).
/** /**
256 import java.util.HashMap;
412 import org.esupportail.helpdesk.exceptions.FileException;
593 130
571
558 438
030 final List<SelectItem> actionScopeItems,
340 /**
338 * True not to ticketOriginItems
184 if (getDomainService().isDepartmentManager(department, getCurrentUser())) {
} return getDomainService().userCanViewTicket(getCurrentUser(), getClient(), getTicket());
*/ * @param minute
300 package org.esupportail.helpdesk.web.controllers;
423 private Department addTargetDepartment;
159 * Add
118 super.reset();
194 */
180 return false;
*/ 361
316
229 457
615 * True not to send alerts
492 * Bean constructor.
369 124
/** final List<SelectItem> ticketScopeItems,
441 * True if the new department
/** * True is monitor the ticket if to new department
*/ * Add
108 * The step
419