Merge from 2.5

This commit is contained in:
Michael RICOIS 2013-11-29 14:18:33 +00:00
parent 24c63fe4dc
commit 717ae35805
4 changed files with 28 additions and 24 deletions

View File

@ -0,0 +1,6 @@
<?php
class Application_Model_InseeTabVilles extends Zend_Db_Table_Abstract
{
protected $_name = 'insee_tabVilles';
protected $_schema = 'insee';
}

View File

@ -1,6 +0,0 @@
<?php
class Application_Model_Sdv1TabCities extends Zend_Db_Table_Abstract
{
protected $_name = 'zonesVilles';
protected $_schema = 'sdv1';
}

View File

@ -64,7 +64,7 @@ class Catalog extends WsScore
return json_encode($tab);
}
/**
* Cities
* @param string $id
@ -75,14 +75,14 @@ class Catalog extends WsScore
public function getCity($id=null, $columns = array())
{
$this->authenticate();
$columnsList = array(
'cp',
'commune',
'codePostal',
'LIBGEO',
);
if (empty($columns) || count($columns)==0) {
$columnsDisplay = array('cp', 'commune');
$columnsDisplay = array('codePostal', 'LIBGEO');
}
// Check authorize column
else {
@ -92,14 +92,14 @@ class Catalog extends WsScore
}
}
}
try {
$model = new Application_Model_sdv1TabCities();
$model = new Application_Model_InseeTabVilles();
$sql = $model->select()->from($model, $columnsDisplay);
if ( $id!==null ) {
$sql->where('cp=?', $id);
$sql->where('codePostal=?', $id);
}
$result = $model->fetchAll($sql);
} catch (Zend_Db_Adapter_Exception $e) {
if ($this->tabInfoUser['idClient']==1) {
@ -110,11 +110,15 @@ class Catalog extends WsScore
} catch (Zend_Exception $e) {
throw new SoapFault('ERR', $e->getMessage());
}
$tab = array();
if ( $result->count()>0 ) {
if ( $result->count()>0 ) {
$i=0;
foreach ( $result as $item ) {
$tab[] = $item->toArray();
//$tab[] = $item->toArray();
$tab[$i]['code'] = $item->codePostal;
$tab[$i]['libelle'] = $item->LIBGEO;
$i++;
}
}
return json_encode($tab);
@ -406,15 +410,15 @@ class Catalog extends WsScore
return json_encode($tab);
}
protected function getHelp($app, $category, $name)
{
}
protected function setHelp($app, $category, $name, $label, $content)
{
}
}

View File

@ -2704,7 +2704,7 @@ class Interne extends WsScore
$sql = $idlocalM->select()
->where('codPays=?', $codeCountry)
->orWhere('codPays IS NULL')
->where('id!=?', 63);
->where('dateSuppr=?', '0000-00-00 00:00:00');
$row = $idlocalM->fetchAll($sql);
} catch (Zend_Db_Exception $e) {
if ($this->tabInfoUser['idClient']!=1) {