Ignore:
Timestamp:
Oct 13, 2012, 4:29:38 PM (12 years ago)
Author:
cljosse
Message:

[extensions] edit_gmaps compatibility 2.4.4 fix bug on global batch_manager

Location:
extensions/edit_gmaps
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • extensions/edit_gmaps/admin/admin.php

    r17778 r18635  
    99else
    1010  $page['tab'] = $_GET['tab'];
    11 
     11 
    1212   $page['tab'] = 'edit';
    1313$my_base_url = get_admin_plugin_menu_link(__FILE__);
     
    1818            ));
    1919
    20          
    21 
    2220include_once( dirname(__FILE__).'/admin_'.$page['tab'].'.php');
    2321$template->assign_var_from_handle( 'BATCH_MANAGER_GLOBAL', 'batch_manager_global');
    2422$template->assign_var_from_handle( 'TAB_DATA', 'tab_data');
    2523$current  =  $template->get_template_vars('BATCH_MANAGER_GLOBAL'); 
    26     $template->concat('TAB_DATA', $current); 
    27 
     24$template->concat('TAB_DATA', $current); 
     25;
    2826
    2927
  • extensions/edit_gmaps/admin/admin_edit.php

    r17779 r18635  
    2424$icon_path = 'themes/default/icon/help.png';
    2525$path_js=  'themes/default/js/' ;
     26 
    2627 
    2728$global_tpl=realpath(PHPWG_ROOT_PATH).'\\admin\\themes\\default\\template\\batch_manager_global.tpl' ;
     
    4142/****************************************************************/
    4243if ( !isset($_GET['mode']) ) $_GET['mode'] = 'global';
    43 if(!isset($_GET['cat'])) $_GET['cat']="" ;
     44
     45//  if(!isset($_GET['cat'])) $_GET['cat']=" " ;
    4446if(isset($_POST['filter_prefilter'])){
    4547  $_GET['cat'] = $_POST['filter_prefilter'];
    4648}
    47 
     49 
    4850if (!isset($page['title'])) $page['title']="";
    4951if(!isset($_POST['selectAction'])) $_POST['selectAction']="" ;
    50 //$info_message .= cl_edit_functions::Memo_Vars($_POST);
     52
    5153//========== Mode GLOBAL ================================
     54
    5255check_input_parameter('selection', $_POST, true, PATTERN_ID);
    5356include (PHPWG_ROOT_PATH.'admin/batch_manager.php');
     
    5760
    5861
    59 
    6062if(isset($page['cat_elements_id']))
    6163    $template->concat('TABSHEET_TITLE', ' '.l10n_dec('%d image', '%d images', count($page['cat_elements_id'])).' - '.$page['title']); 
     
    6365 
    6466 if(isset($_POST)){
    65 //  $info_message .= cl_edit_functions::Memo_Vars($_POST);
     67// $info_message .= cl_edit_functions::Memo_Vars($_POST);
    6668
    6769//===============================================================
     
    103105 
    104106if (count($collection)>0 )
    105   if (isset($_POST['update']) && $_POST['update']==l10n('update_exif')){
     107  if ( isset($_POST['update']) && ( $_POST['update']==l10n('update_exif') || $_POST['update'] == l10n('update_all')  )){
    106108    /***********************************
    107109    *  Mise à jour des meta données
     
    132134      $init_info =true;
    133135      $first_image="";   
    134       $_POST['submit']="";
    135 
     136     
    136137      foreach ($collection as $id_0){
    137138          foreach ($images as $image) { 
     
    140141              // Meta donnée
    141142              //=================================================================
    142                 $infos_gps  = array();
    143                 $lat = trim($_POST['lat']);
    144                 $lon = trim($_POST['lon']);
    145                 $alt = '';
    146       if(isset($_POST['alt']))
    147                 $alt = trim($_POST['alt']);
    148 
    149                 if($image['lat']=='' || $image['lon']==''){
     143
     144                  $lat =(isset($_POST['lat']) && $_POST['lat']  )!=''  ?trim($_POST['lat']):$image['lat'];
     145                  $lon = (isset($_POST['lon']) && $_POST['lon'] )!=''  ?trim($_POST['lon']):$image['lon'];
     146                  $alt =(isset($_POST['alt']) && $_POST['alt']  )!=''?trim($_POST['alt']):$image['alt'];
     147
     148                //========== Mise à jour $image =============               
    150149                    $image['lat']=$lat;
    151150                    $image['lon']=$lon;
    152151                    $image['alt']=$alt;
    153                 }     
    154                 $infos_gps  = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ;
    155 
    156                 if($image['lat']=='' || $image['lon']==''){
    157                     $image['lat']=$infos_gps['lat'];
    158                     $image['lon']=$infos_gps['lon'];
    159                     $image['alt']=$infos_gps['alt'];
    160                 }     
    161 
    162                 if($image['lat']!=''){
    163                       $new_ps_file_info_array=  base_to_meta($image);
    164                   }
     152              //==== lecture info gps ====
     153                    $infos_gps  = array();   
     154                   if ( isset($_POST['lat']) && $_POST['lat']  !=''){
     155                  } else{             
     156                      $infos_gps  = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ; 
     157                      if($infos_gps['lat']!=0){
     158                          $image['lat']=$infos_gps['lat'];
     159                          $image['lon']=$infos_gps['lon'];   
     160                      }
     161                      }
     162                $new_ps_file_info_array =  base_to_meta($image);
    165163
    166164                $new_ps_file_info_array['filename'] =  $image['path'];
    167165                $new_ps_file_info_array['selection'] = explode(";",$new_ps_file_info_array['filename']);
    168    //   
     166 
    169167          if( $image['lat']=="" ){
    170168              $image['lat']=  $new_ps_file_info_array['lat'] ;
     
    172170              $image['alt']=  $new_ps_file_info_array['alt'] ;
    173171          }
    174         if($_POST['update']==l10n('update_exif')) unset($_POST['submit']);
    175         if(1) {
    176  
    177            if(  cl_edit_controler::add_meta_gps($new_ps_file_info_array,$image)){
    178                   $exif = @read_exif_data( $image['path']);
     172
     173         
     174     
     175
     176           if(  cl_edit_controler::add_meta_gps($new_ps_file_info_array,$image)){         
     177                  $exif = @read_exif_data( $image['path']);               
    179178                  $infos_gps  = cl_edit_controler::Get_exif_gps( $image['path'],$image,false,true) ;
    180179                  $info_message .=l10n('update_exif') . " : " .  $image['path'] . " : " . $image['file'] . " : ok<BR />";
    181                 }else{
    182 
    183                 }
    184            }
     180                }
     181           
    185182        }else{
    186183         
    187184        } // fin search
     185
    188186      }   // fin id_0
    189     }     // fin collection     
     187
     188
     189
     190    }     // fin collection   
     191 
     192      if($_POST['update']==l10n('update_exif')) {
     193          unset($_POST['submit']);
     194       }
     195         if ($_POST['update']==l10n('update_all')){
     196            $_POST['submit'] = l10n('update_database') ;
     197
     198            }
     199
    190200    $_POST['update'] ="ok";
     201   
    191202  }
    192203//======================================================================
     
    214225        } 
    215226      }
     227        $_POST['submit'] = l10n('selectAction') ;
     228        unset($_POST['submit']);
    216229    }
    217230 }
     
    224237$categories = array();
    225238$selecteds = array();
     239if(!isset($_GET['cat'])) $_GET['cat']="tag-no";
    226240if (!empty($result)){
    227241  while ($row = mysql_fetch_assoc($result))  {
    228242    $url = $admin_url.get_query_string_diff(array('start','cat')).'&amp;cat='.$row['id'];
     243 
    229244    if ( $row['id']==$_GET['cat'] ) $selecteds[] = $url;
    230245    $row['id']=$url;
     246   
    231247    array_push($categories, $row);
    232248  }
    233249}
     250
    234251usort($categories, 'global_rank_compare');
    235252display_select_categories($categories, $selecteds, 'categories', false);
     
    253270* AFFICHAGE MODE GLOBAL
    254271*************************************/
     272
    255273  foreach ($images as $image){ 
    256274    $infos_gps  = array();
     
    288306  //=================================================
    289307 
    290  $TN_SRC= $current[$j]['TN_SRC'];
     308 $TN_SRC= $current[$j]['thumb'];
    291309 $TITLE=$current[$j]['TITLE'] ;
    292310 
    293    $tpl_var = array(
    294                   'ID' =>$image['id'],
     311   $tpl_var = array( 
     312                  'id' =>$image['id'],
    295313                  'TN_SRC' => $TN_SRC,
    296                   'FILE' => $current[$j]['FILE'],
     314                  'file' => $current[$j]['FILE'],
    297315                   'TITLE' => $TITLE,
    298316                  'LEVEL' =>  $current[$j]['LEVEL'],
     
    303321                  'alt' =>     $image['alt']    ,   
    304322                  'U_EXIF' => $v_exif ,
    305                   'U_BD' =>  $v_db 
     323                  'U_BD' =>  $v_db  ,
     324                  'thumb' =>$current[$j]['thumb']
    306325                   );
    307326             
  • extensions/edit_gmaps/admin/admin_edit.tpl

    r17779 r18635  
    4040 border:outset;
    4141}
    42 .thumbLegend { color:grey;
    43 
    44 }
    45 .thumbLegend:hover { color:white ;
    46 
    47 }
     42 
    4843{/literal}
    4944</style>
     
    6156var  infos_img = infos_img || [];
    6257        {foreach from=$thumbnails item=thumbnail}
    63   infos_img[{$thumbnail.ID}]={ldelim}EXIF:"{$thumbnail.U_EXIF}",
     58  infos_img[{$thumbnail.id}]={ldelim}EXIF:"{$thumbnail.U_EXIF}",
    6459                              BD:"{$thumbnail.U_BD}",
    6560                              lon:"{$thumbnail.lon}",
     
    128123
    129124   <fieldset>
    130     <label>{'command'|@translate}</label>
     125    <label>{'command_cl'|@translate}</label>
    131126
    132127                <table>
     
    203198                        <input class="cluetip submit" title="{'update_exif'|@translate}|{'hlp_update_exif'|@translate}." type="submit" value="{'update_exif'|@translate}" name="update" {$tag_input_enabled} /></td>
    204199                        </td>           
     200                        <td>
     201                        <input class="cluetip submit" title="{'update_all'|@translate}|{'hlp_update_all'|@translate}." type="submit" value="{'update_all'|@translate}" name="update" {$tag_input_enabled} /></td>
     202                        </td>           
     203
    205204        </table>
    206205    </fieldset>
  • extensions/edit_gmaps/admin/js/JScript.js

    r17776 r18635  
    4848    }
    4949  });
    50 
     50   
    5151  jQuery(".thumbLegend").mouseover(function (i) {
    5252    winp = infos_img[this.id];
  • extensions/edit_gmaps/language/fr_FR/lang.php

    r17761 r18635  
    11<?php
    22global $lang;
     3$lang['command_cl']="Lecture : Base de données, Exif";
    34$lang['return']="Retour";
    45$lang['hlp_line4'] .= "Modifie la sélection."; 
    56$lang['update']='Mise à jour ';
    67$lang['update_exif']='Mise à jour EXIF';
     8$lang['update_all']='Mise à jour EXIF & base de données';
     9
    710$lang['update_database']='Mise à jour Base de données';
    811$lang['altitude']='Altitude';
     
    1619$lang['hlp_update_exif']='Met à jour les informations enregistrées dans les metadonnées "exif" des fichier jpeg. ';
    1720$lang['hlp_update_database']='Met à jour les informations enregistrées dans la base de données.';
    18 
     21$lang['hlp_update_all']="Met à jour les informationsdans la base de données et dans les metadonnées 'Exif'. ";
    1922
    2023$lang['search_title']='Rechercher un lieu...';
  • extensions/edit_gmaps/main.inc.php

    r17779 r18635  
    22/*
    33Plugin Name: Edit Maps&Earth
    4 Version: 2.2.5
     4Version: 2.2.6
    55Description:  Editor for rv gmaps
    66Plugin URI: http://piwigo.org/ext/extension_view.php?eid=330
Note: See TracChangeset for help on using the changeset viewer.