Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7e2e8c30

Von Werner Hahn vor etwa 7 Jahren hinzugefügt

  • ID 7e2e8c30b0668383f7a2459d3df285279dfd7d94
  • Vorgänger f749e320
  • Nachfolger bf624ffb

Shopmodul: Bilder hochladen und löschen

Unterschiede anzeigen:

SL/Controller/ShopPart.pm
131 131
  $self->file->delete;
132 132

  
133 133
  $self->js
134
    ->run('kivi.ShopPart.show_images',$self->file->trans_id)
134
    ->run('kivi.ShopPart.show_images',$self->file->object_id)
135 135
    ->render();
136 136
}
137 137

  
SL/ShopConnector/Shopware.pm
262 262
                  description => $img->file->title,
263 263
                  position    => $img->position,
264 264
                  extension   => $extension,
265
                  path        => $path,
265 266
                      )}    ;
266 267
    push( @upload_img, $temp);
267 268
  }
......
360 361

  
361 362
  my $dataString = SL::JSON::to_json(\%shop_data);
362 363
  $dataString = encode_utf8($dataString);
364
  $main::lxdebug->dump(0, 'WH:UPLOAD ', $dataString);
363 365
  my $upload_content;
364 366
  if($import->{success}){
365 367
    #update
js/kivi.File.js
170 170
    return false;
171 171
  }
172 172

  
173
  ns.delete_file = function(id,controller_action) {
174
    $.post('controller.pl', { action: controller_action, id: id }, function(data) {
175
      kivi.eval_json_result(data);
176
    });
177
  };
178

  
173 179
  ns.unimport = function(id,type,file_type,checkbox_class) {
174 180
    var checkboxes = $('.'+checkbox_class).filter(function () { return  $(this).prop('checked'); });
175 181

  
js/kivi.ShopPart.js
104 104
  }
105 105

  
106 106
  ns.show_images = function(id) {
107
    var url = 'controller.pl?action=ShopPart/show_files&modul=shop_part&id='+id;
107
    var url = 'controller.pl?action=ShopPart/show_files&id='+id;
108 108
    $('#shop_images').load(url);
109 109
  }
110 110

  
......
154 154
                                 },
155 155
                        id:     'files_upload',
156 156
                        dialog: { title: upload_title, width: 650, height: 240 } });
157
    kivi.ShopPart.show_image(id);
157 158
    return true;
158 159
  }
159 160

  
templates/webpages/shop_part/_list_images.html
23 23
      <td>[% HTML.escape(img.file.description) %]</td>
24 24
      <td>[% HTML.escape(img.file.file_name) %]</td>
25 25
      <td>[% HTML.escape(img.org_file_width) _  ' x ' _ HTML.escape(img.org_file_height) %]</td>
26
      <td>[% L.button_tag("kivi.FileUploader.delete_file(" _ img.id _ ", 'ShopPart/ajax_delete_file')", LxERP.t8('Delete'), confirm=LxERP.t8("Are you sure?")) %] [% L.button_tag("kivi.FileUploader.add_file(" _ img.id _ "," _ FORM.id _ ",'shop_part','ShopPart/ajax_update_file','jpg|png|tif|gif')", LxERP.t8('Edit')) %] </td>
26
      <td>[% L.button_tag("kivi.File.delete_file(" _ img.file_id _ ", 'ShopPart/ajax_delete_file')", LxERP.t8('Delete'), confirm=LxERP.t8("Are you sure?")) %] [% L.button_tag("kivi.FileUploader.add_file(" _ img.id _ "," _ FORM.id _ ",'shop_part','ShopPart/ajax_update_file','jpg|png|tif|gif')", LxERP.t8('Edit')) %] </td>
27 27
    </tr>
28 28
   [%  END %]
29 29
  </tbody>

Auch abrufbar als: Unified diff