Commit f888b45d7ead2d2b981a2fa8ad99726fe3449c48
1 parent
6c084633
Exists in
master
and in
7 other branches
Correção de bug nas opções de seleção que estavam duplicando elementos quando da…
… seleção por mais de uma vez do mesmo elemento
Showing
1 changed file
with
3 additions
and
0 deletions
Show diff stats
classesphp/classe_selecao.php
@@ -511,6 +511,7 @@ $shp_atual - Indices dos elementos já selecionados. | @@ -511,6 +511,7 @@ $shp_atual - Indices dos elementos já selecionados. | ||
511 | $this->layer->set("template","none.htm"); | 511 | $this->layer->set("template","none.htm"); |
512 | $indxlayer = $this->layer->index; | 512 | $indxlayer = $this->layer->index; |
513 | $shp = array_merge($shpi,$shp_atual); | 513 | $shp = array_merge($shpi,$shp_atual); |
514 | + $shp = array_unique($shp); | ||
514 | $this->mapa->freequery($indxlayer); | 515 | $this->mapa->freequery($indxlayer); |
515 | foreach ($shp as $indx) | 516 | foreach ($shp as $indx) |
516 | {@$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | 517 | {@$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} |
@@ -534,6 +535,7 @@ $shp_atual - Indices dos elementos já selecionados. | @@ -534,6 +535,7 @@ $shp_atual - Indices dos elementos já selecionados. | ||
534 | $indxlayer = $this->layer->index; | 535 | $indxlayer = $this->layer->index; |
535 | $this->mapa->freequery($indxlayer); | 536 | $this->mapa->freequery($indxlayer); |
536 | $shp = array_diff($shp_atual,$shpi); | 537 | $shp = array_diff($shp_atual,$shpi); |
538 | + $shp = array_unique($shp); | ||
537 | $this->mapa->freequery($indxlayer); | 539 | $this->mapa->freequery($indxlayer); |
538 | foreach ($shp as $indx) | 540 | foreach ($shp as $indx) |
539 | {$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} | 541 | {$this->mapa->querybyindex($indxlayer,-1,$indx,MS_TRUE);} |
@@ -558,6 +560,7 @@ $ids - Ids separados por vírgula correspondendo aos registros. | @@ -558,6 +560,7 @@ $ids - Ids separados por vírgula correspondendo aos registros. | ||
558 | {$this->mapa->loadquery(($this->arquivo)."qy");} | 560 | {$this->mapa->loadquery(($this->arquivo)."qy");} |
559 | $ids = explode(",",$ids); | 561 | $ids = explode(",",$ids); |
560 | $indxlayer = $this->layer->index; | 562 | $indxlayer = $this->layer->index; |
563 | + $ids = array_unique($ids); | ||
561 | foreach ($ids as $i) | 564 | foreach ($ids as $i) |
562 | {$this->mapa->queryByIndex($indxlayer, -1, $i);} | 565 | {$this->mapa->queryByIndex($indxlayer, -1, $i);} |
563 | $this->mapa->savequery(($this->arquivo)."qy"); | 566 | $this->mapa->savequery(($this->arquivo)."qy"); |