Changeset 4917 for extensions


Ignore:
Timestamp:
Feb 19, 2010, 9:11:02 PM (15 years ago)
Author:
grum
Message:

Stat consolidations don't work : bug fixed

Location:
extensions/AMetaData
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • extensions/AMetaData/admin/amd_database.tpl

    r4905 r4917  
    138138       }).responseText;
    139139
    140       pct=100*(i+1)/(list.length+2);
     140      pct=100*(i+1)/list.length;
    141141      $("#iprogressbar_bg").css("width", pct+"%");
    142142      $("#iprogressbar_fg").html(Math.round(pct)+"%");
    143143    }
    144144
    145     for(j=0;j<3;j++)
    146     {
    147       tmp = $.ajax({
    148         type: "POST",
    149         url: "{/literal}{$datas.urlRequest}{literal}",
    150         async: false,
    151         data: { ajaxfct:"makeStatsConsolidate", step:j }
    152        }).responseText;
    153 
    154       pct=100*(i+j+1)/(list.length+2);
    155       $("#iprogressbar_bg").css("width", pct+"%");
    156       $("#iprogressbar_fg").html(Math.round(pct)+"%");
    157     }
     145    tmp = $.ajax({
     146      type: "POST",
     147      url: "{/literal}{$datas.urlRequest}{literal}",
     148      async: false,
     149      data: { ajaxfct:"makeStatsConsolidation" }
     150     }).responseText;
     151
    158152
    159153    timeEnd = new Date();
  • extensions/AMetaData/amd_aip.class.inc.php

    r4916 r4917  
    149149        case 'makeStatsDoAnalyze':
    150150          $result=$this->ajax_amd_makeStatsDoAnalyze($_REQUEST['imagesList']);
     151          break;
     152        case 'makeStatsConsolidation':
     153          $result=$this->ajax_amd_makeStatsConsolidation();
    151154          break;
    152155        case 'makeStatsGetStatus':
     
    834837      }
    835838    }
    836 
    837     $sql="UPDATE ".$this->tables['used_tags']." ut,
    838             (SELECT COUNT(imageId) AS nb, numId
    839               FROM ".$this->tables['images_tags']."
    840               GROUP BY numId) nb
    841           SET ut.numOfImg = nb.nb
    842           WHERE ut.numId = nb.numId;";
    843     pwg_query($sql);
    844 
    845839    return(trim($returned).";");
    846840  }
     
    897891
    898892  /**
     893   * do some consolidation on database to optimize other requests
     894   *
     895   */
     896  private function ajax_amd_makeStatsConsolidation()
     897  {
     898
     899    $sql="UPDATE ".$this->tables['used_tags']." ut,
     900            (SELECT COUNT(imageId) AS nb, numId
     901              FROM ".$this->tables['images_tags']."
     902              GROUP BY numId) nb
     903          SET ut.numOfImg = nb.nb
     904          WHERE ut.numId = nb.numId;";
     905    pwg_query($sql);
     906
     907    return($returned);
     908  }
     909
     910  /**
    899911   * returns a list of formated string, separated with a semi-colon :
    900912   *  - number of current analyzed pictures + number of current analyzed tags
Note: See TracChangeset for help on using the changeset viewer.