Changeset 27265


Ignore:
Timestamp:
Feb 8, 2014, 11:26:08 AM (6 years ago)
Author:
mistic100
Message:

fix bugs in "import all" and level sync

Location:
extensions/flickr2piwigo
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extensions/flickr2piwigo/admin/import.php

    r26180 r27265  
    284284    $template->assign(array(
    285285      'nb_elements' => count($all_photos),
    286       'all_elements' => $all_photos,
     286      'all_elements' => json_encode($all_photos),
    287287      'F_ACTION' => FLICKR_ADMIN . '-import&action=import_set',
    288288      ));
  • extensions/flickr2piwigo/admin/template/import.list_all.tpl

    r27242 r27265  
    22(function($){
    33  /* global vars */
    4   var all_elements = [{if !empty($all_elements)}{','|@implode:$all_elements}{/if}];
     4  var all_elements = {$all_elements};
    55  var import_done = 0;
    66  var import_selected = {$nb_elements};
  • extensions/flickr2piwigo/include/ws_functions.inc.php

    r27242 r27265  
    9898    $photo['category'] = array($photo['category']);
    9999  }
    100  
    101   // level
    102   $level = 0;
    103   if (in_array('level', $photo['fills']) && !$photo['visibility']['ispublic'])
    104   {
    105     $level = 8;
    106     if ($photo['visibility']['isfamily']) $level = 4;
    107     if ($photo['visibility']['isfriend']) $level = 2;
    108   }
    109100
    110101  // add photo
    111   $photo['image_id'] = add_uploaded_file($photo['path'], basename($photo['path']), $photo['category'], $level);
     102  $photo['image_id'] = add_uploaded_file($photo['path'], basename($photo['path']), $photo['category']);
    112103
    113104  // do some updates
     
    127118      $updates['latitude'] = pwg_db_real_escape_string($photo['location']['latitude']);
    128119      $updates['longitude'] = pwg_db_real_escape_string($photo['location']['longitude']);
     120    }
     121    if (in_array('level', $photo['fills']) && !$photo['visibility']['ispublic'])
     122    {
     123      $updates['level'] = 8;
     124      if ($photo['visibility']['isfamily']) $updates['level'] = 4;
     125      if ($photo['visibility']['isfriend']) $updates['level'] = 2;
    129126    }
    130127
Note: See TracChangeset for help on using the changeset viewer.