Merge from 2.9
This commit is contained in:
commit
aa1da6105a
@ -850,7 +850,6 @@ class PiecesController extends Zend_Controller_Action
|
||||
}
|
||||
$this->view->assign('actes', $actes);
|
||||
|
||||
$this->view->assign('ModeEdition', $user->checkModeEdition());
|
||||
$this->view->assign('email', $user->getEmail());
|
||||
$this->view->assign('siren', $siren);
|
||||
$this->view->assign('siret', $this->siret);
|
||||
@ -999,8 +998,8 @@ class PiecesController extends Zend_Controller_Action
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = 'bilan-'.$siren.'-'.$type.'-'.$dateCloture.'.pdf';
|
||||
if (copy($stream->getStreamName(), $c->profil->path->shared . '/temp/files/' . $file)) {
|
||||
$this->view->assign('url', $this->view->url(array('module'=>'file', 'controller'=>'fichier',
|
||||
'action' => 'greffe', 'q'=>$file), 'default', true));
|
||||
$this->view->assign('url', $this->view->url(array('module'=>'file', 'controller'=>'greffe',
|
||||
'action' => 'association', 'q'=>$file), 'default', true));
|
||||
} else {
|
||||
$this->view->assign('msg', "Impossible de distribuer le fichier.");
|
||||
}
|
||||
|
@ -906,95 +906,6 @@ class SaisieController extends Zend_Controller_Action
|
||||
$this->view->assign('siret', $siret);
|
||||
}
|
||||
|
||||
public function associationAction()
|
||||
{
|
||||
$this->_helper->layout()->disableLayout();
|
||||
|
||||
$request = $this->getRequest();
|
||||
$type = $request->getParam('type');
|
||||
$siren = $request->getParam('siren');
|
||||
$waldec = $request->getParam('waldec');
|
||||
|
||||
//Téléchargement du fichier
|
||||
if ( isset($_FILES) && count($_FILES)==1 ) {
|
||||
$this->_helper->viewRenderer->setNoRender(true);
|
||||
|
||||
if ( empty($siren) ) {
|
||||
echo "Pas d'identifiant!";
|
||||
} else {
|
||||
|
||||
$c = Zend_Registry::get('config');
|
||||
$path = $c->profil->path->shared.'/persist/association';
|
||||
|
||||
if ( $type=='bilan' ){
|
||||
$dateCloture = $request->getParam('dateCloture');
|
||||
if (strlen($dateCloture)!=8) {
|
||||
echo "Erreur format date cloture";
|
||||
}
|
||||
$path.= '/bilans';
|
||||
$name = $siren.'_'.$dateCloture;
|
||||
} elseif ( $type=='acte' ) {
|
||||
$date = $request->getParam('date');
|
||||
if (strlen($date)!=8) {
|
||||
echo "Erreur format date";
|
||||
}
|
||||
$name = 'ST-'.$siren.'-'.$date;
|
||||
$path.= '/actes';
|
||||
}
|
||||
|
||||
$n = $_FILES['fichier']['name'];
|
||||
$s = $_FILES['fichier']['size'];
|
||||
$tmp_name = $_FILES['fichier']['tmp_name'];
|
||||
|
||||
$extValide = array('pdf');
|
||||
$extension = strrchr($n,'.');
|
||||
$extension = strtolower(substr($extension,1));
|
||||
//Vérifier l'extension du fichier
|
||||
if( !in_array($extension, $extValide) ){
|
||||
echo "Extension de fichier incorrect !";
|
||||
} elseif ( move_uploaded_file($tmp_name, $path.'/'.$name.'.'.$extension) ){
|
||||
|
||||
$result = true;
|
||||
//Send info to webservice
|
||||
if ( $type='acte' ) {
|
||||
$ws = new WsScores();
|
||||
$info = $ws->setActeAsso($siren, $waldec, 'ST', 'Statut', $date);
|
||||
if (is_string($info)) {
|
||||
$result = false;
|
||||
}
|
||||
}
|
||||
|
||||
//Display message
|
||||
if ($result) {
|
||||
echo "Fichier envoyé, <a target=\"_blank\" href=\"".$this->view->url(array(
|
||||
'controller' => 'fichier',
|
||||
'action' => 'pdfassociation',
|
||||
'file' => $name.'.'.$extension,
|
||||
), 'default', true)."\">Cliquez pour voir le fichier</a>";
|
||||
}
|
||||
|
||||
} else {
|
||||
echo "Erreur lors du déplacement du fichier !";
|
||||
}
|
||||
}
|
||||
//Affichage formulaire
|
||||
} else {
|
||||
|
||||
$this->view->inlineScript()->appendFile('/libs/form/jquery.form.min.js');
|
||||
if ( intval($siren)==0 ) {
|
||||
$session = new Scores_Session_Entreprise();
|
||||
$siren = '';
|
||||
if ( substr($session->AutreId,0,1)=='W' ) {
|
||||
$siren = $session->AutreId;
|
||||
}
|
||||
}
|
||||
$this->view->assign('siren', $siren);
|
||||
$this->view->assign('type', $type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function liasseAction()
|
||||
{
|
||||
$request = $this->getRequest();
|
||||
|
@ -80,40 +80,6 @@
|
||||
</tbody>
|
||||
</table>
|
||||
<?php }?>
|
||||
|
||||
<?php
|
||||
//Lien pour upload acte association
|
||||
if ($this->ModeEdition) {
|
||||
?>
|
||||
<a id="acteUpload" href="<?=$this->url(array('controller'=>'saisie', 'action'=>'association', 'type'=>'acte', 'siren'=>$this->siren))?>" title="Envoi Acte/Statut Association">
|
||||
<b>Envoyer un acte</b>
|
||||
</a>
|
||||
<script>
|
||||
$('#acteUpload').on('click', function(e){
|
||||
e.preventDefault();
|
||||
var url = $(this).attr('href');
|
||||
var title = $(this).attr('title');
|
||||
var dialogOpts = {
|
||||
bgiframe: true,
|
||||
title: title,
|
||||
width: 500,
|
||||
height: 400,
|
||||
modal: true,
|
||||
open: function(event, ui) {
|
||||
$(this).html('Chargement...');
|
||||
$(this).load(url);
|
||||
},
|
||||
buttons: {
|
||||
Fermer: function() { $(this).dialog('close'); }
|
||||
},
|
||||
close: function() { $('#dialogacteupload').remove(); }
|
||||
};
|
||||
$('<div id="dialogacteupload"></div>').dialog(dialogOpts);
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
<?php }?>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
@ -1,25 +0,0 @@
|
||||
<form action="<?=$this->url(array('controller'=>'saisie', 'action'=>'association'))?>" method="post" name="sendfile">
|
||||
<input type="hidden" name="siren" value="<?=$this->siren?>" />
|
||||
<input type="hidden" name="type" value="<?=$this->type?>" />
|
||||
<?php if ( $this->type=='bilan' ) {?>
|
||||
Date Cloture : <input type="text" name="dateCloture" /> (JJMMAAAA)<br/><br/>
|
||||
Bilan : <input type="file" name="fichier" />
|
||||
<?php } elseif ($this->type=='acte') {?>
|
||||
Date : <input type="text" name="date" /> (AAAAMMJJ)<br/><br/>
|
||||
Status : <input type="file" name="fichier" />
|
||||
<?php } ?>
|
||||
<input type="submit" name="Envoyer" />
|
||||
</form>
|
||||
<i>Uniquement fichier pdf</i>
|
||||
<div id="output"></div>
|
||||
<?=$this->inlineScript()?>
|
||||
<script>
|
||||
$('form[name=sendfile]').ajaxForm({
|
||||
beforeSubmit: function() {
|
||||
$('#output').html('Envoi en cours...');
|
||||
},
|
||||
success: function(data) {
|
||||
$('#output').html('<strong>' + data + '</strong>');
|
||||
}
|
||||
});
|
||||
</script>
|
@ -11,7 +11,7 @@ class File_GreffeController extends Zend_Controller_Action
|
||||
{
|
||||
$filename = $this->getRequest()->getParam('q');
|
||||
$c = Zend_Registry::get('config');
|
||||
$file = $c->profil->path->shared.'/persist/association/'.$filename;
|
||||
$file = $c->profil->path->shared.'/temp/files/'.$filename;
|
||||
$content_type = 'application/pdf';
|
||||
//Envoi du fichier sur la sortie standard
|
||||
if ( file_exists($file) ) {
|
||||
|
Loading…
Reference in New Issue
Block a user