Correct streetview following the release
This commit is contained in:
parent
9ec923f54c
commit
2e0e6cc0ad
@ -1160,6 +1160,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
public function streetviewAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
$siret = $request->getParam('siret');
|
||||
|
||||
if ( $request->isXmlHttpRequest() ) {
|
||||
$this->_helper->layout()->disableLayout();
|
||||
@ -1169,7 +1170,7 @@ class IdentiteController extends Zend_Controller_Action
|
||||
$lon = $request->getParam('lon', '');
|
||||
$num = $request->getParam('heading', 0);
|
||||
|
||||
$streetview = new Scores_Google_Streetview();
|
||||
$streetview = new Scores_Google_Streetview($siret);
|
||||
if ( $lat != '' && $lon != '' ) {
|
||||
$deg = $streetview->getNumDeg();
|
||||
$nbImg = count($deg);
|
||||
|
@ -348,7 +348,7 @@ class UserController extends Zend_Controller_Action
|
||||
$this->view->form = $form;
|
||||
$request = $this->getRequest();
|
||||
if ( $request->isPost() ) {
|
||||
$formData = $request->getPost ();
|
||||
$formData = $request->getPost();
|
||||
if ($form->isValid($formData)) {
|
||||
$login = $form->getValue('login');
|
||||
$pass = $form->getValue('pass');
|
||||
@ -634,8 +634,8 @@ class UserController extends Zend_Controller_Action
|
||||
}
|
||||
catch ( Zend_Mail_Transport_Exception $e ){
|
||||
$message = $e->getMessage();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$this->view->assign('message', $message);
|
||||
}
|
||||
|
@ -2,8 +2,9 @@
|
||||
|
||||
<div id="infogeo_photo">
|
||||
<?=$this->action('streetview', 'identite', null, array(
|
||||
'lat' => $this->infos->GeoLat,
|
||||
'lon' => $this->infos->GeoLon
|
||||
'lat' => $this->infos->GeoLat,
|
||||
'lon' => $this->infos->GeoLon,
|
||||
'siret' => $this->infos->Siret,
|
||||
));?>
|
||||
</div>
|
||||
|
||||
|
@ -74,14 +74,21 @@ class Scores_Google_Streetview
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public function __construct()
|
||||
protected $siret;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function __construct($siret)
|
||||
{
|
||||
$this->size = '320x320';
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$ths->path = realpath($c->profil->path->data).'/google/streetview';
|
||||
$this->siret = $siret;
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$this->path = realpath($c->profil->path->data).'/google/streetview';
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,6 +159,7 @@ class Scores_Google_Streetview
|
||||
require_once 'common/curl.php';
|
||||
$page = getUrl($this->url, '', '', '', false);
|
||||
|
||||
Zend_Registry::get('firebug')->info('URL = '.$this->url);
|
||||
if ( !in_array($page['code'], array(400, 408, 403)) ) {
|
||||
$body = $page['body'];
|
||||
file_put_contents($this->pathImg(), $body);
|
||||
@ -174,7 +182,9 @@ class Scores_Google_Streetview
|
||||
*/
|
||||
public function display()
|
||||
{
|
||||
$this->url = $this->urlImg();
|
||||
$file = $this->pathImg();
|
||||
Zend_Registry::get('firebug')->info('Filename = '.$file);
|
||||
if ( !file_exists($file) ) {
|
||||
$this->getImg();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user