Merge modification surveillance
This commit is contained in:
commit
56c725d140
27
includes/surveillance/index.php
Normal file
27
includes/surveillance/index.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
<?php
|
||||||
|
isset($_REQUEST['q']) ? $q = $_REQUEST['q'] : $q = '';
|
||||||
|
$params = explode('/', $q);
|
||||||
|
$action = $params[0];
|
||||||
|
|
||||||
|
require_once realpath(dirname(__FILE__)).'/surveillance.php';
|
||||||
|
|
||||||
|
switch ( $action ){
|
||||||
|
case 'ajouter':
|
||||||
|
$siret = $params[1];
|
||||||
|
$source = isset($params[2]) ? $params[2] : '' ;
|
||||||
|
$return = formSurveillance($source, $siret, array(), true);
|
||||||
|
echo $return;
|
||||||
|
break;
|
||||||
|
case 'setsurv':
|
||||||
|
$set = setSurveillance($_REQUEST['formSurv']);
|
||||||
|
FB::log($set, 'set');
|
||||||
|
if ( $set == '' ){
|
||||||
|
$return = '';
|
||||||
|
} elseif ( $set===false ){
|
||||||
|
$return = 'Erreur : Mise sous surveillance impossible.'."\n";
|
||||||
|
} else {
|
||||||
|
$return = 'Erreur : '.$set."\n";
|
||||||
|
}
|
||||||
|
echo $return;
|
||||||
|
break;
|
||||||
|
}
|
@ -1,31 +0,0 @@
|
|||||||
$(document).ready(function(){
|
|
||||||
$('input[type=checkbox][name=surveillance]').click(function() {
|
|
||||||
if($(this).attr('checked')== true){
|
|
||||||
$('#survForm').css('display','block');
|
|
||||||
}else{
|
|
||||||
$('#survForm').css('display','none');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
var options = {
|
|
||||||
target: '#frmSurv',
|
|
||||||
url: './pages/ajax_surveillance.php',
|
|
||||||
beforeSubmit: showRequest,
|
|
||||||
success: showResponse
|
|
||||||
};
|
|
||||||
|
|
||||||
$('#frmSurv').submit(function() {
|
|
||||||
$(this).ajaxSubmit(options);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
function showRequest(formData, jqForm, options) {
|
|
||||||
$('#frmSurv').replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function showResponse(responseText, statusText) {
|
|
||||||
$('#frmSurv').replaceWith('' + responseText + '');
|
|
||||||
if(statusText == 'success'){ return true; }else{ return false; }
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,28 +0,0 @@
|
|||||||
$(document).ready(function(){
|
|
||||||
var siren = '';
|
|
||||||
var options = {
|
|
||||||
target: '#frmSurv',
|
|
||||||
url: './pages/ajax_surveillance.php',
|
|
||||||
beforeSubmit: showRequest,
|
|
||||||
success: showResponse
|
|
||||||
};
|
|
||||||
|
|
||||||
$('#frmSurv').submit(function() {
|
|
||||||
$(this).ajaxSubmit(options);
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
function showResponse(responseText, statusText) {
|
|
||||||
$("#frmSurv").replaceWith('' + responseText + '');
|
|
||||||
if(statusText == 'success' && siren != ''){
|
|
||||||
document.location.href = './?page=surveillance';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function showRequest(formData, jqForm, options) {
|
|
||||||
var value = $('input[type=hidden][name=formSurv[siret]]').fieldValue();
|
|
||||||
siren = value[0];
|
|
||||||
$("#frmSurv").replaceWith('<div id="frmSurv">Mise sous surveillance en cours...</div>');
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
});
|
|
@ -1,23 +0,0 @@
|
|||||||
form { clear:both; }
|
|
||||||
form em { color:#FF0000;}
|
|
||||||
fieldset {border:0; margin:0; padding:0;}
|
|
||||||
fieldset legend{ padding:0 0 0 10px;}
|
|
||||||
.fieldgrp{clear:both; width:100%; margin-bottom:.5em; overflow:hidden;}
|
|
||||||
.fieldgrp:after{content:"."; display:block; clear:both; visibility:hidden; line-height:0; height:0; }
|
|
||||||
.fieldgrp label{font-weight:bold; margin-left:30px; width:180px; clear:both; padding:0 10px 0 0;line-height:22px;_padding-top:3px; float:left; display:block; font-size:108%;}
|
|
||||||
.fieldgrp label span{font-weight:normal;}
|
|
||||||
.fieldgrp label abbr{color:#4B911C; font-size:120%; vertical-align:middle;}
|
|
||||||
.field {float:left; padding:0 10px 0 0;line-height:22px;_padding-top:3px;}
|
|
||||||
.field .longfield{width:215px;}
|
|
||||||
.field .longfield-select{width:220px;}
|
|
||||||
.field .smallfield{width:95px;}
|
|
||||||
.field .medfield{width:110px;}
|
|
||||||
.field input, .field select{ font-size:110%; margin:2px 0; }
|
|
||||||
.field input[type="radio"] { margin:0 5px 0 5px; }
|
|
||||||
div.submit{ margin-left:200px; padding-left:0px; margin-top:1em; }
|
|
||||||
div.submit p.submit-button{margin-top:0;}
|
|
||||||
div.submit p.details{font-size:85%;color:#666;margin:0;}
|
|
||||||
div.submit p.required-note{margin-top:1em;}
|
|
||||||
div.submit p.required-note span{color:#4B911C;_color:#666;font-size:170%;vertical-align:top;}
|
|
||||||
input.submit {border:none;}
|
|
||||||
#survForm {display:none;}
|
|
@ -47,10 +47,10 @@ function formSurveillance($source, $siret, $notEmail, $inDialog = false)
|
|||||||
|
|
||||||
$output = '';
|
$output = '';
|
||||||
|
|
||||||
if($inDialog){
|
if ( $inDialog ){
|
||||||
$output.= '<style type="text/css">'.$style.'</style>'."\n";
|
$output.= '<style type="text/css">'.$style.'</style>'."\n";
|
||||||
$output.= '<form id="frmSurv" name="frmSurv" '.
|
$output.= '<form id="frmSurv" name="frmSurv" '.
|
||||||
'action="./pages/ajax_surveillance.php" method="post">'."\n";
|
'action="./?page=surveillance" method="post">'."\n";
|
||||||
$output.= '<input name="q" type="hidden" value="setsurv"/>';
|
$output.= '<input name="q" type="hidden" value="setsurv"/>';
|
||||||
$output.= '<input name="formSurv[siret]" type="hidden" value="'.
|
$output.= '<input name="formSurv[siret]" type="hidden" value="'.
|
||||||
$siret.'"/>'."\n";
|
$siret.'"/>'."\n";
|
||||||
@ -124,14 +124,14 @@ function formSurveillance($source, $siret, $notEmail, $inDialog = false)
|
|||||||
$output.= '</div>'."\n";
|
$output.= '</div>'."\n";
|
||||||
$output.= '</form>'."\n";
|
$output.= '</form>'."\n";
|
||||||
|
|
||||||
}else{
|
} else {
|
||||||
$texte = 'Mettre sous surveillance ';
|
$texte = 'Mettre sous surveillance ';
|
||||||
if( !empty($source) ) {
|
if( !empty($source) ) {
|
||||||
$texte.= $assocSourceTxt[$source];
|
$texte.= $assocSourceTxt[$source];
|
||||||
}
|
}
|
||||||
$output.= '<br/>';
|
$output.= '<br/>';
|
||||||
$output.= lienSousSurveillance($texte,
|
$output.= lienSousSurveillance($texte,
|
||||||
'Ajouter la surveillance', $source, $siret);
|
'Ajouter la surveillance', $source, $siret);
|
||||||
$output.= '<br/>'."\n";
|
$output.= '<br/>'."\n";
|
||||||
}
|
}
|
||||||
return $output;
|
return $output;
|
||||||
@ -181,10 +181,11 @@ function getSurveillance($source, $siret){
|
|||||||
* @param string $siret
|
* @param string $siret
|
||||||
*/
|
*/
|
||||||
function lienSousSurveillance($texte, $titre, $source, $siret){
|
function lienSousSurveillance($texte, $titre, $source, $siret){
|
||||||
return '<a class="dialogsurv" '.
|
$output = '<a class="dialogsurv" href="./?page=surveillance&q=ajouter';
|
||||||
'href="./pages/ajax_surveillance.php?q=ajouter&siret='.
|
$output.= '/'.$siret;
|
||||||
$siret.'&source='.$source.'" '.
|
if ( !empty($source) ) { $output.= '/'.$source; }
|
||||||
'title="'.$titre.' '.$source.'">'. $texte . '</a>';
|
$output.= '" title="'.$titre.' '.$source.'">'. $texte . '</a>';
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -251,7 +252,7 @@ function inSurveillance($source, $siret){
|
|||||||
'dateAjout' => $item['dateAjout'],
|
'dateAjout' => $item['dateAjout'],
|
||||||
'dateDerEnvoi' => $item['dateDerEnvoi'],
|
'dateDerEnvoi' => $item['dateDerEnvoi'],
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -300,9 +301,9 @@ function setSurveillance($tabForm)
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Mise en surveillance pour une liste de sources
|
//Mise en surveillance pour une liste de sources
|
||||||
if (is_array($source)){
|
if ( is_array($source) ){
|
||||||
foreach ($source as $s){
|
foreach ( $source as $s ){
|
||||||
try{
|
try {
|
||||||
$result = $client->setSurveillance($siret, $email, $ref, $s,
|
$result = $client->setSurveillance($siret, $email, $ref, $s,
|
||||||
false, $encours);
|
false, $encours);
|
||||||
$result = '';
|
$result = '';
|
||||||
@ -310,7 +311,6 @@ function setSurveillance($tabForm)
|
|||||||
$result = false;
|
$result = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Mise en surveillance pour une source
|
//Mise en surveillance pour une source
|
||||||
} else {
|
} else {
|
||||||
try{
|
try{
|
||||||
|
@ -156,10 +156,10 @@ switch ($page)
|
|||||||
$page2 = 'evenements.php';
|
$page2 = 'evenements.php';
|
||||||
require_once realpath(dirname(__FILE__)).'/pages/main.php';
|
require_once realpath(dirname(__FILE__)).'/pages/main.php';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'saisieajax':
|
case 'saisieajax':
|
||||||
require_once '../includes/saisie/index.php';
|
require_once '../includes/saisie/index.php';
|
||||||
exit; break;
|
exit;
|
||||||
|
break;
|
||||||
case 'saisie':
|
case 'saisie':
|
||||||
$title = titreAvecSiren('Saisie/Edition');
|
$title = titreAvecSiren('Saisie/Edition');
|
||||||
if (hasModeEdition()){
|
if (hasModeEdition()){
|
||||||
@ -340,6 +340,12 @@ switch ($page)
|
|||||||
require_once realpath(dirname(__FILE__)).'/pages/main.php';
|
require_once realpath(dirname(__FILE__)).'/pages/main.php';
|
||||||
break;
|
break;
|
||||||
case 'surveillance':
|
case 'surveillance':
|
||||||
|
//Gestion des requetes en Ajax
|
||||||
|
if ( isset($_REQUEST['q']) ){
|
||||||
|
require_once '../includes/surveillance/index.php';
|
||||||
|
exit;
|
||||||
|
}
|
||||||
|
//Affichage des surveillances
|
||||||
$title = 'Liste des établissements sous suveillances';
|
$title = 'Liste des établissements sous suveillances';
|
||||||
if (hasPerm('survliste')){
|
if (hasPerm('survliste')){
|
||||||
$page2 = 'options_surv.php';
|
$page2 = 'options_surv.php';
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
$(document).ready(function()
|
$(document).ready(function()
|
||||||
{
|
{
|
||||||
$('#synthese a[tooltip]').each(function()
|
$('#synthese a[tooltip]').each(function(){
|
||||||
{
|
|
||||||
$(this).qtip({
|
$(this).qtip({
|
||||||
content: $(this).attr('tooltip'),
|
content: $(this).attr('tooltip'),
|
||||||
style: { width: 500, name: 'dark' },
|
style: { width: 500, name: 'dark' },
|
||||||
@ -9,10 +8,8 @@ $(document).ready(function()
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.sTip').each(function()
|
$('.sTip').each(function(){
|
||||||
{
|
$(this).qtip({
|
||||||
$(this).qtip(
|
|
||||||
{
|
|
||||||
content: {
|
content: {
|
||||||
text: 'Chargement...',
|
text: 'Chargement...',
|
||||||
url: $(this).attr('rel'),
|
url: $(this).attr('rel'),
|
||||||
@ -38,10 +35,8 @@ $(document).ready(function()
|
|||||||
$(location).attr('href',$(this).val());
|
$(location).attr('href',$(this).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.scoreTip').each(function()
|
$('.scoreTip').each(function(){
|
||||||
{
|
$(this).qtip({
|
||||||
$(this).qtip(
|
|
||||||
{
|
|
||||||
content: {
|
content: {
|
||||||
text: 'Chargement...',
|
text: 'Chargement...',
|
||||||
url: $(this).attr('rel'),
|
url: $(this).attr('rel'),
|
||||||
|
@ -111,7 +111,7 @@ if($source == ''){
|
|||||||
<?php
|
<?php
|
||||||
//Affichage du nombre de surveillances
|
//Affichage du nombre de surveillances
|
||||||
$nbEtab = count($listTrier);
|
$nbEtab = count($listTrier);
|
||||||
if($vue=='default'){
|
if ( $vue == 'default' ){
|
||||||
?>
|
?>
|
||||||
<table id="info">
|
<table id="info">
|
||||||
<tr>
|
<tr>
|
||||||
@ -124,7 +124,7 @@ if($vue=='default'){
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?php
|
<?php
|
||||||
}else{
|
} else {
|
||||||
?>
|
?>
|
||||||
<table id="info">
|
<table id="info">
|
||||||
<tr>
|
<tr>
|
||||||
@ -342,20 +342,18 @@ foreach($listTrier as $item)
|
|||||||
foreach($tabSource as $source => $perm)
|
foreach($tabSource as $source => $perm)
|
||||||
{
|
{
|
||||||
FB::log($source, $perm);
|
FB::log($source, $perm);
|
||||||
if(hasPerm('surv'.$perm))
|
if ( hasPerm('surv'.$perm) )
|
||||||
{
|
{
|
||||||
if(array_key_exists($source, $item['sources']))
|
if ( array_key_exists($source, $item['sources']) ){
|
||||||
{
|
foreach ( $item['sources'][$source] as $surveillance ){
|
||||||
foreach($item['sources'][$source] as $surveillance)
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<div class="action">
|
<div class="action">
|
||||||
<p><?=ucfirst($source)?></p>
|
<p><?=ucfirst($source)?></p>
|
||||||
<a class="dialogsurv" href="./pages/ajax_surveillance.php?q=ajouter&siret=<?=$item['siren'].$item['nic']?>&source=<?=$source?>"
|
<a class="dialogsurv" href="./?page=surveillance&q=ajouter/<?=$item['siren'].$item['nic']?>/<?=$source?>"
|
||||||
title="Ajouter la surveillance <?=$source?>">
|
title="Ajouter la surveillance <?=$source?>">
|
||||||
<img src="./img/interface/ajouter.png"/>
|
<img src="./img/interface/ajouter.png"/>
|
||||||
</a>
|
</a>
|
||||||
<a class="dialogsurv" href="./pages/ajax_surveillance.php?q=ajouter&siret=<?=$item['siren'].$item['nic']?>&source=<?=$source?>&ref=<?=$surveillance['ref']?>&email=<?=$surveillance['email']?>"
|
<a class="dialogsurv" href="./?page=surveillance&q=ajouter/<?=$item['siren'].$item['nic']?>/<?=$source?>&ref=<?=$surveillance['ref']?>&email=<?=$surveillance['email']?>"
|
||||||
title="Editer la surveillance <?=$source?>">
|
title="Editer la surveillance <?=$source?>">
|
||||||
<img src="./img/interface/editer.png"/>
|
<img src="./img/interface/editer.png"/>
|
||||||
</a>
|
</a>
|
||||||
@ -366,13 +364,13 @@ foreach($listTrier as $item)
|
|||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
?>
|
?>
|
||||||
<div class="action">
|
<div class="action">
|
||||||
<p><?=ucfirst($source)?></p>
|
<p><?=ucfirst($source)?></p>
|
||||||
<a class="dialogsurv" href="./pages/ajax_surveillance.php?q=ajouter&siret=<?=$item['siren'].$item['nic']?>&source=<?php print $source;?>" title="Ajouter la surveillance <?=$source?>"><img src="./img/interface/ajouter.png"/></a>
|
<a class="dialogsurv" href="./?page=surveillance&q=ajouter/<?=$item['siren'].$item['nic']?>/<?=$source;?>" title="Ajouter la surveillance <?=$source?>">
|
||||||
|
<img src="./img/interface/ajouter.png"/>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
@ -416,12 +414,10 @@ foreach($listTrier as $item)
|
|||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
//si vue=source alors on a forcément qu'une seul source donc 1 ligne par surveillance d'entité
|
//si vue=source alors on a forcément qu'une seul source donc 1 ligne par surveillance d'entité
|
||||||
}
|
} elseif( $vue == 'source' ) {
|
||||||
elseif($vue=='source')
|
foreach ( $listTrier as $item ){
|
||||||
{
|
?>
|
||||||
foreach($listTrier as $item){
|
<tr>
|
||||||
?>
|
|
||||||
<tr>
|
|
||||||
<td class="aleft"><a href="./?page=identite&siret=<?=$item['siren'].$item['nic']?>"><?=$item['siren']?></a></td>
|
<td class="aleft"><a href="./?page=identite&siret=<?=$item['siren'].$item['nic']?>"><?=$item['siren']?></a></td>
|
||||||
<td><?=$item['rs']?><br/><i><?=$item['cp'].' '.$item['ville']?></i></td>
|
<td><?=$item['rs']?><br/><i><?=$item['cp'].' '.$item['ville']?></i></td>
|
||||||
<td>
|
<td>
|
||||||
@ -434,8 +430,12 @@ foreach($listTrier as $item){
|
|||||||
<td class="aleft">
|
<td class="aleft">
|
||||||
<div class="action">
|
<div class="action">
|
||||||
<p><?=ucfirst($item['source'])?></p>
|
<p><?=ucfirst($item['source'])?></p>
|
||||||
<a class="dialogsurv" href="./pages/ajax_surveillance.php?q=ajouter&siret=<?=$item['siren'].$item['nic']?>&source=<?php print $item['source'];?>&ref=<?php print $item['ref'];?>&email=<?php print $item['email'];?>" title="Editer la surveillance <?php print $item['source'];?>"><img src="./img/interface/editer.png"/></a>
|
<a class="dialogsurv" href="./?page=surveillance&q=ajouter/<?=$item['siren'].$item['nic']?>/<?=$item['source']?>&ref=<?=$item['ref']?>&email=<?=$item['email']?>" title="Editer la surveillance <?=$item['source']?>">
|
||||||
<a href="./?page=surveillance&action=supprimer&siret=<?$item['siren'].$item['nic']?>&ref=<?php print $item['ref']; ?>&source=<?php print $item['source'];?>&email=<?php print $item['email']; ?>" title="Supprimer la surveillance <?php print $item['source'].' '.$item['email'];?>"><img src="./img/interface/supprimer.png"/></a>
|
<img src="./img/interface/editer.png"/>
|
||||||
|
</a>
|
||||||
|
<a href="./?page=surveillance&action=supprimer&siret=<?=$item['siren'].$item['nic']?>&ref=<?=$item['ref']?>&source=<?=$item['source']?>&email=<?=$item['email']?>" title="Supprimer la surveillance <?=$item['source'].' '.$item['email']?>">
|
||||||
|
<img src="./img/interface/supprimer.png"/>
|
||||||
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<br/>
|
<br/>
|
||||||
</td>
|
</td>
|
||||||
@ -450,9 +450,9 @@ foreach($listTrier as $item){
|
|||||||
if ($pDate!='00/00/0000'){print '<p>'.$pDate.'</p>'; }else{ print '<p>-</p>';}
|
if ($pDate!='00/00/0000'){print '<p>'.$pDate.'</p>'; }else{ print '<p>-</p>';}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
}//Fin vue==source
|
}//Fin vue==source
|
||||||
?>
|
?>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@ -11,7 +11,7 @@ $position = isset($_REQUEST['p']) ? $_REQUEST['p'] : 0 ;
|
|||||||
|
|
||||||
$nbAffichage = 100;
|
$nbAffichage = 100;
|
||||||
|
|
||||||
switch($tri){
|
switch ( $tri ){
|
||||||
default:
|
default:
|
||||||
case 'siren': $triws = 'siren'; break;
|
case 'siren': $triws = 'siren'; break;
|
||||||
case 'rs': $triws = 'rs'; break;
|
case 'rs': $triws = 'rs'; break;
|
||||||
@ -22,7 +22,7 @@ switch($tri){
|
|||||||
}
|
}
|
||||||
|
|
||||||
//Liste des surveillances score de l'utilisateur
|
//Liste des surveillances score de l'utilisateur
|
||||||
try{
|
try {
|
||||||
$O = $client->getPortefeuille(0, $position, $nbAffichage, $triws);
|
$O = $client->getPortefeuille(0, $position, $nbAffichage, $triws);
|
||||||
$listSurveillance = $O['results']['reponses'];
|
$listSurveillance = $O['results']['reponses'];
|
||||||
|
|
||||||
@ -277,7 +277,7 @@ if(count($listSurveillance)>0)
|
|||||||
$item['procol']!='P' && $item['actif']!=0)
|
$item['procol']!='P' && $item['actif']!=0)
|
||||||
{
|
{
|
||||||
?>
|
?>
|
||||||
<a class="dialogsurv editencours" href="./pages/ajax_surveillance.php?q=ajouter&siret=<?=$item['siren'].$item['nic']?>&source=score&ref=<?=$item['ref']?>&email=<?=$item['email']?>"
|
<a class="dialogsurv editencours" href="./?page=surveillance&q=ajouter/<?=$item['siren'].$item['nic']?>/score&ref=<?=$item['ref']?>&email=<?=$item['email']?>"
|
||||||
title="Editer encours">
|
title="Editer encours">
|
||||||
<img src="./img/interface/editer.png"/>
|
<img src="./img/interface/editer.png"/>
|
||||||
</a>
|
</a>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user