Changeset 6476
- Timestamp:
- 06/13/12 13:01:49 (11 years ago)
- Location:
- trunk/prototype/modules/calendar
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/modules/calendar/css/layout.css
r6369 r6476 227 227 .new-event-win ul.attendee-permissions-list, li.attendee-permissions-list{text-align: left;} 228 228 229 li.attendee-permissions-list input{width: 20px !important; margin: 3px 0 0 0 ; !important}229 li.attendee-permissions-list input{width: 20px !important; margin: 3px 0 0 0 !important;} 230 230 231 231 p.request-update{display: inline; position: relative; top: 2px;} … … 398 398 .import-export-win form { padding: 10px; } 399 399 .import-export-win p.input-group * { float:left; } 400 401 402 label.messagesHelpers{display: block; position: absolute; left: 60px; top: 21px;} 400 403 401 404 /* -- calendar list styles -- */ -
trunk/prototype/modules/calendar/interceptors/DBMapping.php
r6393 r6476 539 539 540 540 if (isset($v['id'])) { 541 $result[$i]['participants'] = Controller::find( array( 'concept' => 'participant' ) , false ,array( 'filter' => array('=', 'schedulable' , $v['id']),'deepness' => $original['criteria']['deepness'] - 1 )); 541 $data = self::decodeParticipantsEvent($uri, $v, $criteria, $original); 542 543 $result[$i]['statusAttendees'] = isset($data['statusAttendees']) ? $data['statusAttendees'] : false; 544 $result[$i]['sizeAttendees'] = isset($data['sizeAttendees']) ? $data['sizeAttendees'] : false; 545 $result[$i]['participants'] = $data['attendees']; 542 546 543 547 $attachmentRelation = Controller::find(array('concept' => 'schedulableToAttachment'), false, array('filter' => array('=', 'schedulable', $v['id']))); … … 563 567 return $result; 564 568 } 569 565 570 566 571 //TODO: Remover apos suporte a deepness na api … … 689 694 ///////////////////////////////////////////////////////////////////////// 690 695 691 static function dayAlarm( &$uri , &$params , &$criteria , $original ) { 696 static function decodeParticipantsEvent( &$uri, $result, &$criteria, $original) { 697 $participants = Controller::find( array( 'concept' => 'participant' ) , false ,array( 'filter' => array('=', 'schedulable' , $result['id']) )); 698 699 if($participants && ($size = count($participants)) < 100){ 700 if(isset($original['criteria']['deepness']) && $original['criteria']['deepness'] != 0){ 701 self::deepnessFindParticipant($uri, $participants, $criteria, $original); 702 $participants['attendees'] = $participants; 703 } 704 705 }else if($participants && ($size = count($participants)) > 100){ 706 $owner = Controller::read( array( 'concept' => 'calendarSignature' ) , false ,array( 'filter' => array('AND', array('=', 'calendar' , $result['calendar']), array('=', 'isOwner', '1')))); 707 $owner = Controller::read( array( 'concept' => 'participant' ) , false ,array( 'filter' => array('AND', array('=', 'schedulable' , $result['id']), array('=', 'user', $owner[0]['user'])), 'deepness' => 2)); 708 709 if(is_array($owner)) 710 $owner = $owner[0]; 711 712 $reference = array_slice($participants, 0, 100); 713 $organizer = false; 714 $asOwner = false; 715 716 foreach($reference as $r => &$v){ 717 if($v['id'] == $owner['id']){ 718 $v = $owner; 719 $asOwner = true; 720 continue; 721 } 722 723 self::deepnessReadParticipant($uri, $v, $criteria, $original); 724 725 if($v['isOrganizer'] == "1" ) 726 $organizer = $v; 727 } 728 729 if(!$organizer){ 730 $organizer = Controller::find( array( 'concept' => 'participant' ) , false ,array( 'filter' => array('AND', array('=', 'schedulable' , $result['id']), array('=', 'isOrganizer', '1')), 'deepness' => 2)); 731 732 array_push($reference, $organizer[0]); 733 734 }else if($organizer && ($organizer['id'] != $owner['id'])) 735 array_merge($reference, $organizer); 736 737 if(!$asOwner) 738 array_push($reference, $owner); 739 740 $statusAttendees = array( 'default' => 0, 'accepted' => 0, 'tentative' => 0, 'cancelled' => 0, 'unanswered' => 0, 'delegated' => 0 ); 741 $statusLabels = array( 'default', 'accepted', 'tentative', 'cancelled', 'unanswered', 'delegated' ); 742 743 foreach($participants as $k => &$p){ 744 if(!$organizer && $p['isOrganizer'] == "1"){ 745 self::deepnessReadParticipant($uri, $p, $criteria, $original); 746 $reference = array_merge($reference, array($p)); 747 } 748 749 $statusAttendees[$statusLabels[$p['status']]]++; 750 } 751 752 $participants['statusAttendees'] = $statusAttendees; 753 $participants['sizeAttendees'] = $size; 754 $participants['attendees'] = $reference; 755 } 756 757 return $participants; 758 } 759 760 static function dayAlarm( &$uri , &$params , &$criteria , $original ) { 692 761 if(isset($criteria['filter'][1]) && $criteria['filter'][1] == 'date') 693 762 { … … 884 953 //Criaremos uma agenda padrão 885 954 $cal = array('name' => 'Calendario', 886 'description' => 'Calendario Padr ᅵo',955 'description' => 'Calendario Padrão', 887 956 'timezone' => (date_default_timezone_get()) ? date_default_timezone_get() : 'America/Sao_Paulo', 888 957 'dtstamp' => time() . '000' -
trunk/prototype/modules/calendar/js/calendar.codecs.js
r6444 r6476 499 499 500 500 var isShared = !objEvent.id ? false : (!!objEvent.calendar) && parseInt(Calendar.signatureOf[objEvent.calendar].isOwner) ? false : true; 501 501 var limitAttendee = false; 502 502 503 503 return { … … 587 587 me: me, 588 588 delegatedFrom: delegatedFrom, 589 statusParticipants: statusParticipants 589 statusParticipants: (objEvent.sizeAttendees != "") ? objEvent.statusAttendees : statusParticipants, 590 sizeAttendeeLimit: (objEvent.sizeAttendees != "") ? objEvent.sizeAttendees : false 590 591 }; 591 592 }); -
trunk/prototype/modules/calendar/js/helpers.js
r6444 r6476 437 437 438 438 /** 439 440 441 442 443 439 * Uma vez aberta uma janela de confirmação (Zebra_Dialog), ao fechá-la 440 * com ESC, para que o evento ESC não seja propagado para fechamento da 441 * janela de edição de eventos, deve ser setada uma flag indicando que 442 * já existe uma janela de confirmação aberta. 443 */ 444 444 if (!clicked) { 445 445 window.setTimeout(function() { … … 658 658 return Calendar.signatures[i].calendar.id; 659 659 } 660 660 661 /*Seleciona a agenda padrão para visualização/edição de um evento*/ 662 if(objEvent.id) 663 UI.dialogs.addEvent.find('option[value="'+objEvent.calendar+'"]').attr('selected','selected').trigger('change'); 664 661 665 /*Adicionar alarms padrões, quando alterado a agenda do usuário*/ 662 666 UI.dialogs.addEvent.find('select[name="calendar"]').change(function(){ … … 678 682 $(this).parent().remove().find('li').is(':empty'); 679 683 }); 684 680 685 }else{ 681 686 UI.dialogs.addEvent.find('input[name="defaultAlarm"]').parent().addClass('hidden'); … … 683 688 } 684 689 685 var participant = UI.dialogs.addEvent.find('dd.me input[name="attendee[]"]').val(); 686 if( !parseInt(Calendar.signatureOf[$(this).val()].isOwner) ){ 687 var signature = Calendar.signatureOf[$(this).val()]; 690 var participant = UI.dialogs.addEvent.find('dd.me input[name="attendee[]"]').val(); 691 var calendar = $(this).val(); 692 693 if( !parseInt(Calendar.signatureOf[calendar].isOwner) ){ 694 var signature = Calendar.signatureOf[calendar]; 688 695 var organizer = DataLayer.get('calendarSignature', { 689 696 filter: ['AND', ['=','calendar',signature.calendar.id], ['=','isOwner','1']], … … 717 724 .filter('.mail').html(User.me.mail).attr('title',User.me.mail); 718 725 } 726 719 727 }); 720 728 … … 1530 1538 if(acls.remove) 1531 1539 UI.dialogs.addEvent.find('.button.remove').show(); 1532 1533 UI.dialogs.addEvent.find('.button.cancel').show(); 1534 1535 1540 1541 UI.dialogs.addEvent.find('.button.cancel').show(); 1536 1542 } 1537 1543 … … 1539 1545 1540 1546 /*Seleciona a agenda padrão para criação de um evento*/ 1541 var selectedCalendar = (objEvent.calendar != undefined) ? objEvent.calendar : (User.preferences.defaultCalendar ? User.preferences.defaultCalendar : myCalendar()); 1542 UI.dialogs.addEvent.find('option[value="'+selectedCalendar+'"]').attr('selected','selected').trigger('change'); 1543 1547 if(!objEvent.id){ 1548 var selectedCalendar = (objEvent.calendar != undefined) ? objEvent.calendar : (User.preferences.defaultCalendar ? User.preferences.defaultCalendar : myCalendar()); 1549 UI.dialogs.addEvent.find('option[value="'+selectedCalendar+'"]').attr('selected','selected').trigger('change'); 1550 } 1544 1551 UI.dialogs.addEvent.find(':input').change(function(event){ 1545 1552 if (event.keyCode != '27' && event.keyCode != '13') … … 2543 2550 } 2544 2551 } 2545 $tabs.tabs("select", currentView); 2552 if(currentView != '#tab_events_list_') 2553 $tabs.tabs("select", currentView); 2546 2554 } 2547 2555 … … 2758 2766 2759 2767 } 2760 2761 2762 } 2768 } 2769 2770 function messageHelper(msg, isShow){ 2771 if(isShow) 2772 new $.Zebra_Dialog('<span style="width: 50px; height: 50px;">'+ 2773 '<img src="'+DataLayer.dispatchPath+'/modules/calendar/img/loading.gif"></img>'+ 2774 '</span><label class="messagesHelpers"> '+ msg +' </label>' , { 2775 'buttons': false, 2776 'modal': true, 2777 'overlay_opacity': '0.5', 2778 'keyboard': false, 2779 'overlay_close': false, 2780 'type': false, 2781 'custom_class': 'messagesHelpersExpressoCalendar' 2782 } 2783 ); 2784 else{ 2785 $('.messagesHelpersExpressoCalendar').remove(); 2786 $('.ZebraDialogOverlay').remove(); 2787 } 2788 } -
trunk/prototype/modules/calendar/templates/attendee_add.ejs
r6370 r6476 3 3 %> 4 4 <dl class="block-attendee-list attendees-list"> 5 <dt class="me"><%= data.event.me. name %></dt>5 <dt class="me"><%= data.event.me.user ? data.event.me.user.name : data.event.me.name %></dt> 6 6 <dd class="me"> 7 7 <select class="status" name="status" <%= data.event.isAttendee ? '' : 'disabled' %>> … … 145 145 <% if (data.event && data.event.attendee.length > 0) { %> 146 146 <ul class="attendees-count"> 147 147 <li><label>Sim:</label><%=data.event.statusParticipants.accepted%></li> 148 148 <li><label>Não:</label><%=data.event.statusParticipants.cancelled%></li> 149 149 <li><label>Talvez:</label><%=data.event.statusParticipants.tentative%></li> 150 150 <li><label>Aguardando:</label><%=data.event.statusParticipants.unanswered%></li> 151 151 </ul> 152 <% } %> 153 <% if (data.event && data.event.sizeAttendeeLimit){%> 154 <ul class="attendees-count"> 155 <li>Evento com muitos participantes, exibindo os 100 primeiros!</li> 156 </ul> 152 157 <% } %> 153 158 </dd>
Note: See TracChangeset
for help on using the changeset viewer.