Changeset 6369
- Timestamp:
- 05/31/12 18:24:52 (12 years ago)
- Location:
- trunk/prototype
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/prototype/config/attachment.ini
r5715 r6369 4 4 [before.create] 5 5 encodeCreateAttachment = modules/calendar/interceptors/DBMapping.php 6 7 [after.delete]8 deleteAttachmentDependences = modules/calendar/interceptors/DBMapping.php9 6 10 7 [PostgreSQL.mapping] -
trunk/prototype/config/schedulableToAttachment.ini
r5715 r6369 5 5 schedulable = schedulable.attachments 6 6 7 [before.delete] 8 decodeSchedulablettachment = modules/calendar/interceptors/DBMapping.php 9 10 [after.delete] 11 deleteAttachmentDependences = modules/calendar/interceptors/DBMapping.php 12 7 13 [PostgreSQL.mapping] 8 14 id = id -
trunk/prototype/modules/calendar/css/layout.css
r6319 r6369 705 705 706 706 .button.add.button-add-attachment{margin: -9px 0 0 8px;} 707 .button.upload{margin-bottom: 4px;} 707 .button.btn-danger.delete{margin: 0 0 0 0;} 708 709 .button.upload{top: 4px;} 710 .button.upload.edit{top: -2px;} 711 708 712 div.fileupload-buttonbar{padding: 0.2em 0.5em } 709 713 .archive-error{color: #F00;} … … 711 715 .progress.in-progress{width: 100px; height: 12px;} 712 716 717 span.status-upload{margin: -4px 0px 0px 0px;} 713 718 714 719 .lbl-archive-nome, .lbl-archive-size{font-weight: bold !important;} … … 1162 1167 .ui-tabs .ui-tabs-panel { padding: 0; margin-top: 10px;} 1163 1168 1169 .ui-tabs #calendar_addevent_details5.ui-tabs-panel{margin-top: -3px; min-height: 323px;} 1170 1164 1171 .ui-tabs .ui-tabs-nav li .ui-icon-close { 1165 1172 float: right; -
trunk/prototype/modules/calendar/interceptors/DBMapping.php
r6345 r6369 813 813 } 814 814 815 public function decodeSchedulablettachment(&$uri, &$params, &$criteria, $original) { 816 if (isset($original['URI']['id'])){ 817 $schedulableAttachment = Controller::read(array('concept' => 'schedulableToAttachment'), false, array('filter' => array( '=', 'attachment' , $original['URI']['id'] ))); 818 $uri['id'] = $schedulableAttachment[0]['id']; 819 } 820 } 821 815 822 public function deleteAttachmentDependences(&$uri, &$params, &$criteria, $original) { 816 817 if (isset($original['URI']['id'])) 818 Controller::delete(array('concept' => 'schedulableToAttachment', null, array('filter' => array('=', 'attachment', $original['URI']['id'])))); 823 Controller::delete(array('concept' => 'attachment', 'id' => $original['URI']['id'])); 819 824 } 820 825 -
trunk/prototype/modules/calendar/js/helpers.js
r6359 r6369 1331 1331 text: 'Excluir' 1332 1332 }).click(function () { 1333 $('.row.fileupload-buttonbar .attachments-list p').remove(); 1334 1335 var ids = []; 1336 $.each($('.attachment-list input'), function (i, input) { 1337 ids.push(input.value); 1338 }); 1339 if(ids.length > 0){ 1340 DataLayer.remove('attachment', { 1341 filter: ['IN', 'id', ids] 1342 }); 1343 $('.attachment-list input').remove(); 1344 } 1333 $.Zebra_Dialog('Tem certeza que deseja excluir todos anexos?', { 1334 'type': 'question', 1335 'overlay_opacity': '0.5', 1336 'buttons': ['Sim', 'Não'], 1337 'onClose': function(clicked) { 1338 if(clicked == 'Sim'){ 1339 1340 var ids = []; 1341 $.each($('.attachment-list input'), function (i, input) { 1342 DataLayer.remove('schedulableToAttachment', { 1343 filter: ['=', 'id', ''+input.value] 1344 }); 1345 }); 1346 $('.attachment-list input').remove(); 1347 $('.row.fileupload-buttonbar .attachments-list p').remove(); 1348 } 1349 }}); 1345 1350 }).end() 1346 1351 .filter('.close').button({ … … 1350 1355 text: false 1351 1356 }).click(function () { 1352 DataLayer.remove(' attachment', $(this).parents('p').find('input[name="fileId[]"]').val());1357 DataLayer.remove('schedulableToAttachment', $(this).parents('p').find('input[name="fileId[]"]').val()); 1353 1358 $(this).parents('p').remove(); 1354 1359 }).end() -
trunk/prototype/modules/calendar/templates/event_add.ejs
r6331 r6369 161 161 162 162 <fieldset class="attachment-list hidden"> 163 <%if(data.event && data.event.attachments){ 164 for (var i=0; i< data.event.attachments.length; i++) {%> 165 <input type="hidden" name="fileId[]" value="<%=data.event.attachments[i].id%>"/> 166 <%} 167 }%> 163 168 </fieldset> 164 169 </form> … … 166 171 <div class="overflow_add_calender"> 167 172 <fieldset id="calendar_addevent_details5" class="tab-level2"> 168 173 <form id="fileupload" action="attachment:detail" method="POST"> 169 174 <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --> 170 175 <div class="row fileupload-buttonbar"> … … 183 188 <%}%> 184 189 </div> 185 190 <div id="fileupload-progress"></div> 186 191 <div class="files-list"> 187 192 <ul class="attachments-list"> … … 197 202 <a href="../prototype/getArchive.php?attachment=<%=data.event.attachments[i].id%>" class="button tiny upload downlaod-archive">Download</a> 198 203 <%if(data.event.acl.organization || data.event.acl.write){%> 199 <span class="button close tiny upload delete-upload" title="Deletar">Deletar</span>204 <span class="button close tiny upload edit delete-upload" title="Deletar">Deletar</span> 200 205 <%}%> 201 206 <input type="hidden" name="fileId[]" value="<%=data.event.attachments[i].id%>"/>
Note: See TracChangeset
for help on using the changeset viewer.