PSMList 0.4.0 PSM-040-033
| Ordre affichage : | 31 | Création : | 15/06/2023 11h48 |
| Index BL : | 33 | Modification : | 19/06/2023 17h19 |
| BL : | PSM-040-033 | ||
| Source : | Aucune | Soeurs : | - |
| Fin dev : | D (Done) | Ticket : | - |
| Contrôle dev effectué : | Fiche : | - | |
| C.Qualif. : | #000000 | ||
| Activé : | Icône FA : | Par défaut | |
| Contact : | ARS - Arshellan | Qualification : | Nouveauté |
| Répartition : | - | Module : | Search |
| Dev : | ARS - Arshellan | Sous module : | UX |
| Provenance : | 0.4.0 New | Constat : | - |
| Début : | S.25 | Charge j. : | - |
| Fin : | S.25 | Délai j. : | - |
| Priorité : | - | Pokercard : | - |
| Estimatif j. : | - | ||
| Description : | Fix the custom selector in the search engine | ||
| Texte Commit : | - | ||
| Description client : | You are now able to search for custom ships! From now on the search form will default to only official pieces, but you can change that by clicking on the corresponding button in the filters. If an expansion was set to not-public by its owner, the ships/crew from that expansion will not show up in the search results. | ||
| Fascicule : | Ne pas communiquer : | ||
| Alerte Mailing : |
| Statut PreP : | OK - Validé | Testeur : | ARS - Arshellan |
replacements in the search route<br/><br/><br/> /* Setting up values to be used in the form's fields */<br/> $options['masts'] = ['0'=>0,'1'=>1,'2'=>2,'3'=>3,'4'=>4,'5'=>5,'6'=>6,'8'=>8,'10'=>10];<br/> $options['type'] = $typeRepo->findBy(array(),array('defaultname'=>'ASC'));<br/> $options['rarity'] = $rarityRepo->findBy(array('usedonship'=>1));<br/> $options['faction'] = $factionRepo->findBy(array(),array('defaultname'=>'ASC'));<br/> $options['technicalshape'] = $technicalshapeRepo->findBy(array(),array('name'=>'ASC'));<br/> $options['extension'] = $extensionRepo->findBy(array('ispublic'=>true),array('searchsort'=>'ASC'));<br/> $options['speed'] = ['S'=>'S','L'=>'L','SS'=>'S+S','SL'=>'S+L','LL'=>'L+L','SSS'=>'S+S+S','SSL'=>'S+S+L','SLL'=>'S+L+L','LLL'=>'L+L+L','D'=>'D','T'=>'T'];<br/> $options['released'] = ['Released'=>1,'Unreleased'=>0];<br/> $options['official'] = ['Both'=>3,'Official'=>2,'Custom'=>1];<br/> $options['pointslider_min'] = $pointslider_min;<br/> $options['pointslider_max'] = $pointslider_max;<br/> $options['pointslider_setmin'] = $pointslider_setmin;<br/> $options['pointslider_setmax'] = $pointslider_setmax;
101 to 105<br/><br/><br/> if ($extensionSearch == null) {$extensionSearch = $extensionRepo->findBy(array('ispublic'=>true), array('searchsort'=>'ASC', 'short'=>'ASC'));}<br/> $releasedSearch = $searchShipForm->get('released')->getData();<br/> if ($releasedSearch == null) {$releasedSearch = 1;}<br/> $officialSearch = $searchShipForm->get('official')->getData();<br/> if ($officialSearch == null) {$officialSearch = 2;}
get shipsearch repository (first part)<br/><br/><br/>// ->andWhere($qb->expr()->in('s.released', ':releasedSearch'))<br/> ;<br/><br/> switch ($officialSearch) {<br/> case 1: $qb->andWhere('ext.custom = 1')->andWhere('ext.ispublic = 1'); break;<br/> case 2: $qb->andWhere('ext.custom = 0'); break;<br/> case 3: $qb->andWhere('ext.ispublic = 1'); break;<br/> }<br/><br/> if ($speedSearch) {<br/> $qb<br/> ->andWhere($qb->expr()->in('s.basemove', ':speedSearch'))<br/> ->setParameter('speedSearch', $speedSearch)<br/> ;<br/> }
last part <br/><br/><br/> $qb<br/> ->addOrderBy('ext.searchsort', 'ASC')<br/> ->addOrderBy('ext.short', 'ASC')<br/> ->addOrderBy('s.numid', 'ASC')<br/> ->setParameter('nameSearch', '%'.addcslashes($nameSearch, '%_').'%') /* done like this to prevent wildcards injection */<br/> ->setParameter('pointSearchMin', $pointSearchMin)<br/> ->setParameter('pointSearchMax', $pointSearchMax)<br/> ->setParameter('numidSearch', '%'.addcslashes($numidSearch, '%_').'%') /* done like this to prevent wildcards injection */<br/> ->setParameter('abilitySearch', '%'.addcslashes($abilitySearch, '%_').'%') /* done like this to prevent wildcards injection */<br/> ->setParameter('mastsSearch', $mastsSearch)<br/> ->setParameter('typeSearch', $typeSearch)<br/>// ->setParameter('releasedSearch', $releasedSearch)<br/>// ->setParameter('officialSearch', $officialSearch)<br/> ;