1042 lines
32 KiB
PHP
1042 lines
32 KiB
PHP
<?php
|
|
class SaisieController extends Zend_Controller_Action
|
|
{
|
|
/**
|
|
* Enter description here ...
|
|
* @var unknown_type
|
|
*/
|
|
protected $tabEvent = array(
|
|
'1100' => 'Ouverture sauvegarde',
|
|
'1200' => 'Redressement Judiciaire',
|
|
'1201' => 'Conversion sauvegarde en Redressement Judiciaire',
|
|
'1300' => 'Conversion Redressement Judiciaire en Liquidation Judiciaire',
|
|
'1301' => 'Ouverture Liquidation Judiciaire',
|
|
'1302' => 'Ouverture Liquidation Judiciaire Simplifiée',
|
|
'1303' => 'Ouverture Liquidation Judiciaire sur résolution du plan',
|
|
'1304' => 'Réouverture Liquidation Judiciaire',
|
|
'1305' => 'Liquidation Judiciaire',
|
|
'1306' => 'Liquidation Judiciaire simplifiée',
|
|
'1307' => 'Conversion sauvegarde en Liquidation Judiciaire',
|
|
'1308' => 'Fin du régime de Liquidation Judiciaire Simplifiée',
|
|
'1309' => 'Conversion Liquidation Judiciaire en Liquidation Judiciaire Simplifiée',
|
|
'1310' => 'Procédure d\'insolvabilité européenne',
|
|
'1311' => 'Liquidation Judiciaire par extension au(x) gérant(s)',
|
|
'1312' => 'Liquidation Judiciaire avec continuation d\'exploitation',
|
|
'1408' => 'Modification du plan de cession',
|
|
'1411' => 'Arrêt du plan de cession',
|
|
'1412' => 'Arrêt du plan de cession partielle',
|
|
'1413' => 'Arrêt du plan de continuation',
|
|
'1414' => 'Arrêt du plan de redressement',
|
|
'1415' => 'Prolongement du plan de cession',
|
|
'1511' => 'Résolution du plan de cession',
|
|
'1502' => 'Clôture de la procédure pour extinction du passif',
|
|
'1503' => 'Clôture de la procédure pour insuffisance d\'actif',
|
|
'1512' => 'Résolution du plan de continuation',
|
|
'1600' => 'Faillite personnelle',
|
|
'1601' => 'Interdiction de gérer',
|
|
'1999' => 'Autre procédure collective',
|
|
'2102' => 'Augmentation du capital social',
|
|
'2100' => 'Diminution du capital social',
|
|
'2202' => 'Dissolution',
|
|
'2206' => 'Mise en sommeil',
|
|
'2319' => 'Poursuite de l\'activité malgré perte > moitié du capital social',
|
|
'2315' => 'Modification de l\'administration',
|
|
'2313' => 'Modification de l\'activité',
|
|
'2305' => 'Modification de la dénomination',
|
|
'2307' => 'Modification de la forme juridique',
|
|
'2303' => 'Modification de la date de clôture de l\'exercice',
|
|
'2306' => 'Modification de la durée de la société',
|
|
'2901' => 'Transfert de siège',
|
|
'5500' => 'Vente/cession : Entreprise réalisant la vente',
|
|
'6700' => 'Radiation',
|
|
'1010' => 'Déclaration de cessation de paiement',
|
|
'1050' => 'Homologation de la conciliation',
|
|
'1055' => 'Résolution de la conciliation',
|
|
);
|
|
|
|
/**
|
|
* Enter description here ...
|
|
* @var unknown_type
|
|
*/
|
|
protected $coursAppel = array(
|
|
array( "triId"=>"1756", "triCode"=>"AIXPRL", "triNom"=>"Cour d'Appel d'Aix-en-Provence", "triCP"=>"13616" ),
|
|
array( "triId"=>"1757", "triCode"=>"AMIENL", "triNom"=>"Cour d'Appel d'Amiens", "triCP"=>"80027" ),
|
|
array( "triId"=>"1758", "triCode"=>"ANGERL", "triNom"=>"Cour d'Appel d'Angers", "triCP"=>"49043" ),
|
|
array( "triId"=>"1759", "triCode"=>"BASSEL", "triNom"=>"Cour d'Appel de Basse-Terre", "triCP"=>"97109" ),
|
|
array( "triId"=>"1760", "triCode"=>"BASTIL", "triNom"=>"Cour d'Appel de Bastia", "triCP"=>"20407" ),
|
|
array( "triId"=>"1761", "triCode"=>"BESANL", "triNom"=>"Cour d'Appel de Besançon", "triCP"=>"25017" ),
|
|
array( "triId"=>"1762", "triCode"=>"BORDEL", "triNom"=>"Cour d'Appel de Bordeaux", "triCP"=>"33077" ),
|
|
array( "triId"=>"1763", "triCode"=>"BOURGL", "triNom"=>"Cour d'Appel de Bourges", "triCP"=>"18023" ),
|
|
array( "triId"=>"1764", "triCode"=>"CAENL", "triNom"=>"Cour d'Appel de Caen", "triCP"=>"14050" ),
|
|
array( "triId"=>"1765", "triCode"=>"CHAMBL", "triNom"=>"Cour d'Appel de Chambéry", "triCP"=>"73018" ),
|
|
array( "triId"=>"1766", "triCode"=>"COLMAL", "triNom"=>"Cour d'Appel de Colmar", "triCP"=>"68027" ),
|
|
array( "triId"=>"1767", "triCode"=>"DIJONL", "triNom"=>"Cour d'Appel de Dijon", "triCP"=>"21034" ),
|
|
array( "triId"=>"1768", "triCode"=>"DOUAIL", "triNom"=>"Cour d'Appel de Douai", "triCP"=>"59507" ),
|
|
array( "triId"=>"1769", "triCode"=>"FORTFL", "triNom"=>"Cour d'Appel de Fort-de-France", "triCP"=>"97200" ),
|
|
array( "triId"=>"1770", "triCode"=>"GRENOL", "triNom"=>"Cour d'Appel de Grenoble", "triCP"=>"38019" ),
|
|
array( "triId"=>"1771", "triCode"=>"LIMOGL", "triNom"=>"Cour d'Appel de Limoges", "triCP"=>"87031" ),
|
|
array( "triId"=>"1772", "triCode"=>"LYONL", "triNom"=>"Cour d'Appel de Lyon", "triCP"=>"69321" ),
|
|
array( "triId"=>"1773", "triCode"=>"METZL", "triNom"=>"Cour d'Appel de Metz", "triCP"=>"57036" ),
|
|
array( "triId"=>"1774", "triCode"=>"MONTPL", "triNom"=>"Cour d'Appel de Montpellier", "triCP"=>"34023" ),
|
|
array( "triId"=>"1775", "triCode"=>"NANCYL", "triNom"=>"Cour d'Appel de Nancy", "triCP"=>"54035" ),
|
|
array( "triId"=>"1776", "triCode"=>"NIMESL", "triNom"=>"Cour d'Appel de Nîmes", "triCP"=>"30031" ),
|
|
array( "triId"=>"1777", "triCode"=>"NOUMEL", "triNom"=>"Cour d'Appel de Nouméa", "triCP"=>"98848" ),
|
|
array( "triId"=>"1778", "triCode"=>"PAPEEL", "triNom"=>"Cour d'Appel de Papeete", "triCP"=>"98714" ),
|
|
array( "triId"=>"1779", "triCode"=>"PARISL", "triNom"=>"Cour d'Appel de Paris", "triCP"=>"75055" ),
|
|
array( "triId"=>"1780", "triCode"=>"PAUL", "triNom"=>"Cour d'Appel de Pau", "triCP"=>"64034" ),
|
|
array( "triId"=>"1781", "triCode"=>"POITIL", "triNom"=>"Cour d'Appel de Poitiers", "triCP"=>"86020" ),
|
|
array( "triId"=>"1782", "triCode"=>"REIMSL", "triNom"=>"Cour d'Appel de Reims", "triCP"=>"51096" ),
|
|
array( "triId"=>"1783", "triCode"=>"RENNEL", "triNom"=>"Cour d'Appel de Rennes", "triCP"=>"35064" ),
|
|
array( "triId"=>"1784", "triCode"=>"RIOML", "triNom"=>"Cour d'Appel de Riom", "triCP"=>"63201" ),
|
|
array( "triId"=>"1785", "triCode"=>"ROUENL", "triNom"=>"Cour d'Appel de Rouen", "triCP"=>"76037" ),
|
|
array( "triId"=>"1786", "triCode"=>"STDENL", "triNom"=>"Cour d'Appel de Saint-Denis-de-La Réunion", "triCP"=>"97488" ),
|
|
array( "triId"=>"1787", "triCode"=>"TOULOL", "triNom"=>"Cour d'Appel de Toulouse", "triCP"=>"31068" ),
|
|
array( "triId"=>"1788", "triCode"=>"VERSAL", "triNom"=>"Cour d'Appel de Versailles", "triCP"=>"78011" ),
|
|
array( "triId"=>"1789", "triCode"=>"ORLEAL", "triNom"=>"Cour d'Appel d'Orléans", "triCP"=>"45044" ),
|
|
array( "triId"=>"1790", "triCode"=>"CAYENL", "triNom"=>"Chambre Détachée de la Cour d'Appel de Fort de France à Cayenne", "triCP"=>"97300" ),
|
|
array( "triId"=>"1798", "triCode"=>"AGENL", "triNom"=>"Cour d'Appel d'Agen", "triCP"=>"47916" ),
|
|
);
|
|
|
|
/**
|
|
* Enter description here ...
|
|
* @var unknown_type
|
|
*/
|
|
protected $selectDir = array(
|
|
'0000' => '-',
|
|
'0900' => 'Gérant',
|
|
'0209' => 'Associé-gérant',
|
|
'0400' => 'Co-gérant',
|
|
'0100' => 'Administrateur',
|
|
'1300' => 'Président',
|
|
'1900' => 'Liquidateur',
|
|
'0709' => 'DG',
|
|
'1306' => 'Président conseil admin.',
|
|
'0704' => 'Directeur gén. délégué',
|
|
'1301' => 'PDG',
|
|
'1800' => 'Vice-président',
|
|
'1401' => 'Représentant soc. étrangère',
|
|
'0603' => 'Contrôleur gestion',
|
|
'1307' => 'Président conseil surv.',
|
|
'1308' => 'Président directoire',
|
|
'0713' => 'Dir. général non admin.',
|
|
'0108' => 'Admin. provisoire',
|
|
'0708' => 'DG unique',
|
|
'0101' => 'Admin. délégué',
|
|
'0912' => 'Gérant non associé',
|
|
'0200' => 'Associé',
|
|
'1651' => 'Sous Gouverneur',
|
|
'0701' => 'DG Adjoint',
|
|
'0705' => 'DG et administrateur',
|
|
'0300' => 'CAC',
|
|
'0303' => 'Commissaire aux comptes suppléant',
|
|
'1650' => 'Gouverneur',
|
|
'0500' => 'Conj. Collaborateur',
|
|
'1600' => 'Secrétaire',
|
|
'1601' => 'Vice-secrétaire',
|
|
'1700' => 'Trésorier',
|
|
'1701' => 'Vice-trésorier',
|
|
);
|
|
|
|
/**
|
|
* Genre
|
|
* @var array
|
|
*/
|
|
protected $selectGenre = array(
|
|
'' => '-',
|
|
'M.' => 'M',
|
|
'Mme' => 'Mme',
|
|
'Mlle' => 'Mlle',
|
|
'Societe' => 'STE'
|
|
);
|
|
|
|
/**
|
|
* Liste des pays
|
|
* @var array
|
|
*/
|
|
protected $selectPays = array(
|
|
'XXX' => "-",
|
|
'FRA' => "France",
|
|
'AND' => "Andorre",
|
|
'ARE' => "Emirats Arabes Unis",
|
|
'AFG' => "Afghanistan",
|
|
'ATG' => "Antigua",
|
|
'AIA' => "Anguilla",
|
|
'ALB' => "Albanie",
|
|
'ARM' => "Arménie",
|
|
'ANT' => "Antilles Néerlandaises",
|
|
'AGO' => "Angola",
|
|
'ATA' => "Antarctique",
|
|
'ARG' => "Argentine",
|
|
'ASM' => "Samoa Américaines",
|
|
'AUT' => "Autriche",
|
|
'AUS' => "Australie",
|
|
'ABW' => "Aruba",
|
|
'AZE' => "Azerbaïdjan",
|
|
'BIH' => "Bosnie-Herzégovine",
|
|
'BRB' => "Barbade",
|
|
'BGD' => "Bangladesh",
|
|
'BEL' => "Belgique",
|
|
'BFA' => "Burkina Faso",
|
|
'BGR' => "Bulgarie",
|
|
'BHR' => "Bahreïn",
|
|
'BDI' => "Burundi",
|
|
'BEN' => "Bénin",
|
|
'BMU' => "Bermudes",
|
|
'BRN' => "Brunei",
|
|
'BOL' => "Bolivie",
|
|
'BRA' => "Brésil",
|
|
'BHS' => "Bahamas",
|
|
'BTN' => "Bhoutan",
|
|
'BVT' => "Iles Bouvet",
|
|
'BWA' => "Botswana",
|
|
'BLR' => "Biélorussie",
|
|
'BLZ' => "Bélize",
|
|
'CAN' => "Canada",
|
|
'CCK' => "Iles Cocos",
|
|
'CAF' => "République Centrafricaine",
|
|
'COG' => "Congo",
|
|
'CHE' => "Suisse",
|
|
'CIV' => "Côte d\'Ivoire",
|
|
'COK' => "Iles Cook",
|
|
'CHL' => "Chili",
|
|
'CMR' => "Cameroun",
|
|
'CHN' => "Chine",
|
|
'COL' => "Colombie",
|
|
'CRI' => "Costa Rica",
|
|
'CSK' => "Tchécoslovaquie",
|
|
'CUB' => "Cuba",
|
|
'CPV' => "Cap-Vert",
|
|
'CXR' => "Ile Christmas",
|
|
'CYP' => "Chypre",
|
|
'CZE' => "Rébublique Tchèque",
|
|
'DDR' => "République Démocratique Allemande",
|
|
'DEU' => "Allemagne",
|
|
'DJI' => "Djibouti",
|
|
'DNK' => "Danemark",
|
|
'DMA' => "Dominique",
|
|
'DOM' => "République Dominicaine",
|
|
'DZA' => "Algérie",
|
|
'ECU' => "Equateur",
|
|
'EST' => "Estonie",
|
|
'EGY' => "Egypte",
|
|
'ESH' => "Sahara Occidental",
|
|
'ERI' => "Eritrea",
|
|
'ESP' => "Espagne",
|
|
'ETH' => "Ethiopie",
|
|
'FIN' => "Finlande",
|
|
'FJI' => "Iles Fidji",
|
|
'FLK' => "Iles Malouines",
|
|
'FSM' => "Etats Fédérés de Micronésie",
|
|
'FRO' => "Iles Féroé",
|
|
'GAB' => "Gabon",
|
|
'GBR' => "Royaume-Uni",
|
|
'GRD' => "Grenade",
|
|
'GEO' => "Géorgie",
|
|
'GUF' => "Guinée française",
|
|
'GHA' => "Ghana",
|
|
'GIB' => "Gibraltar",
|
|
'GRL' => "Groënland",
|
|
'GMB' => "Gambie",
|
|
'GIN' => "Guinée",
|
|
'GLP' => "Guadeloupe",
|
|
'GNQ' => "Guinée Equatoriale",
|
|
'GRC' => "Grèce",
|
|
'SGS' => "Géorgie du sud & Iles Sandwich",
|
|
'GTM' => "Guatemala",
|
|
'GUM' => "Guam",
|
|
'GNB' => "Guinée-Bissau",
|
|
'GUY' => "Guyane",
|
|
'HKG' => "Hong Kong",
|
|
'HMD' => "Iles Heard et Mc Donald",
|
|
'HND' => "Honduras",
|
|
'HRV' => "Croatie",
|
|
'HTI' => "Haïti",
|
|
'HUN' => "Hongrie",
|
|
'IDN' => "Indonésie",
|
|
'IRL' => "Irlande",
|
|
'ISR' => "Israël",
|
|
'IND' => "Inde",
|
|
'IOT' => "Iles Vierges Britanniques",
|
|
'IRQ' => "Irak",
|
|
'IRN' => "Iran",
|
|
'ISL' => "Islande",
|
|
'ITA' => "Italie",
|
|
'JAM' => "Jamaïque",
|
|
'JOR' => "Jordanie",
|
|
'JPN' => "Japon",
|
|
'KEN' => "Kenya",
|
|
'KGZ' => "Kirghizistan",
|
|
'KHM' => "Cambodge",
|
|
'KIR' => "Kiribati",
|
|
'COM' => "Comores",
|
|
'KNA' => "Saint-Kitts",
|
|
'PRK' => "Corée",
|
|
'KOR' => "République de Corée",
|
|
'KWT' => "Koweït",
|
|
'CYM' => "Iles Caïman",
|
|
'KAZ' => "Kazakhstan",
|
|
'LAO' => "Laos",
|
|
'LBN' => "Liban",
|
|
'LCA' => "Sainte-Lucie",
|
|
'LIE' => "Liechtenstein",
|
|
'LKA' => "Sri Lanka",
|
|
'LBR' => "Libéria",
|
|
'LSO' => "Lesotho",
|
|
'LTU' => "Lithuanie",
|
|
'LUX' => "Luxembourg",
|
|
'LVA' => "Lettonie",
|
|
'LBY' => "Libye",
|
|
'MAR' => "Maroc",
|
|
'MCO' => "Monaco",
|
|
'MDA' => "Moldavie",
|
|
'MDG' => "Madagascar",
|
|
'MHL' => "Iles Marshall",
|
|
'MKD' => "Macédoine",
|
|
'MLI' => "Mali",
|
|
'MMR' => "Myanmar",
|
|
'MNG' => "Mongolie",
|
|
'MAC' => "Macao",
|
|
'MNP' => "Iles Mariannes",
|
|
'MTQ' => "Martinique",
|
|
'MRT' => "Mauritanie",
|
|
'MSR' => "Montserrat",
|
|
'MLT' => "Malte",
|
|
'MUS' => "Ile Maurice",
|
|
'MDV' => "Maldives",
|
|
'MWI' => "Malawi",
|
|
'MEX' => "Mexique",
|
|
'MYS' => "Malaisie",
|
|
'MOZ' => "Mozambique",
|
|
'NAM' => "Namibie",
|
|
'NCL' => "Nouvelle Calédonie",
|
|
'NER' => "Niger",
|
|
'NFK' => "Iles Norfolk",
|
|
'NGA' => "Nigeria",
|
|
'NIC' => "Nicaragua",
|
|
'NLD' => "Pays-Bas",
|
|
'NOR' => "Norvège",
|
|
'NPL' => "Népal",
|
|
'NRU' => "Nauru",
|
|
'NTZ' => "Zone Neutre",
|
|
'NIU' => "Niue",
|
|
'NZL' => "Nouvelle Zélande",
|
|
'OMN' => "Oman",
|
|
'PAN' => "Panama",
|
|
'PER' => "Pérou",
|
|
'PYF' => "Polynésie Francaise",
|
|
'PNG' => "Papouasie Nouvelle-Guinée",
|
|
'PHL' => "Philippines",
|
|
'PAK' => "Pakistan",
|
|
'POL' => "Pologne",
|
|
'SPM' => "Saint Pierre et Miquelon",
|
|
'PCN' => "Pitcairn",
|
|
'PRI' => "Porto Rico",
|
|
'PRT' => "Portugal",
|
|
'PLW' => "Palau",
|
|
'PRY' => "Paraguay",
|
|
'QAT' => "Qatar",
|
|
'REU' => "Ile de la Réunion",
|
|
'ROM' => "Roumanie",
|
|
'RUS' => "Russie",
|
|
'RWA' => "Rwanda",
|
|
'SAU' => "Arabie Saoudite",
|
|
'SLB' => "Iles Salomon",
|
|
'SYC' => "Seychelles",
|
|
'SDN' => "Soudan",
|
|
'SWE' => "Suède",
|
|
'SGP' => "Singapour",
|
|
'SHN' => "Sainte-Hélène",
|
|
'SVN' => "Slovénie",
|
|
'SJM' => "Spitsberg et lle Jan Mayen",
|
|
'SVK' => "Slovaquie",
|
|
'SLE' => "Sierra Leone",
|
|
'SMR' => "Saint-Marin",
|
|
'SEN' => "Sénégal",
|
|
'SOM' => "Somalie",
|
|
'SUR' => "Surinam",
|
|
'STP' => "São Tomé et Principe",
|
|
'SUN' => "URSS",
|
|
'SLV' => "Salvador",
|
|
'SYR' => "Syrie",
|
|
'SWZ' => "Swaziland",
|
|
'TCA' => "Iles Turques et Caïques",
|
|
'TCD' => "Tchad",
|
|
'ATF' => "Terres Australes Francaises",
|
|
'TGO' => "Togo",
|
|
'THA' => "Thaïlande",
|
|
'TJK' => "Tadjikistan",
|
|
'TKL' => "Iles Tokélaou",
|
|
'TKM' => "Turkménistan",
|
|
'TUN' => "Tunisie",
|
|
'TON' => "Tonga",
|
|
'TMP' => "Timor Oriental",
|
|
'TUR' => "Turquie",
|
|
'TTO' => "Trinité-et-Tobago",
|
|
'TUV' => "Tuvalu",
|
|
'TWN' => "Taïwan, République de Chine",
|
|
'TZA' => "Tanzanie",
|
|
'UKR' => "Ukraine",
|
|
'UGA' => "Ouganda",
|
|
'UMI' => "Iles mineures éloignées des E.U",
|
|
'USA' => "Etats Unis",
|
|
'URY' => "Uruguay",
|
|
'UZB' => "Ouzbékistan",
|
|
'VAT' => "Vatican",
|
|
'VCT' => "Saint Vincent et les Grenadines",
|
|
'VEN' => "Vénézuéla",
|
|
'VGB' => "Iles Vierges Britaniques",
|
|
'VIR' => "Iles Vierges U.S",
|
|
'VNM' => "Vietnam",
|
|
'VUT' => "Vanuatu",
|
|
'WLF' => "Wallis et Futuna",
|
|
'WSM' => "Samoa Américaines",
|
|
'XBA' => "Rép. Turque de Chypre",
|
|
'YMD' => "Yémen (République Démocratique)",
|
|
'YEM' => "Yemen",
|
|
'MYT' => "Mayotte",
|
|
'YUG' => "Yougoslavie",
|
|
'ZAF' => "Afrique du sud",
|
|
'ZMB' => "Zambie",
|
|
'ZAR' => "Zaïre",
|
|
'ZWE' => "Zimbabwe",
|
|
);
|
|
|
|
public function init()
|
|
{
|
|
require_once 'Scores/WsScores.php';
|
|
require_once 'Scores/Utilisateur.php';
|
|
require_once 'Scores/SessionEntreprise.php';
|
|
require_once 'Scores/IdentiteEntreprise.php';
|
|
require_once 'common/dates.php';
|
|
|
|
$this->view->headLink()->appendStylesheet('/themes/default/styles/saisie.css', 'all');
|
|
}
|
|
|
|
/**
|
|
* Index
|
|
*/
|
|
public function indexAction(){}
|
|
|
|
/**
|
|
* Afficahge du formulaire de saisie
|
|
* @todo : Enregistrement des informations en session pour récupération
|
|
*/
|
|
public function ficheAction()
|
|
{
|
|
$this->view->headScript()->appendFile('/themes/default/scripts/saisie.js', 'text/javascript');
|
|
$this->view->headTitle()->append('Saisie - '.$this->siret);
|
|
|
|
$request = $this->getRequest();
|
|
$siret = $request->getParam('siret');
|
|
$id = $request->getParam('id', 0);
|
|
|
|
$ws = new WsScores();
|
|
$infos = $ws->getIdentite($siret, $id);
|
|
$devisesReponse = $ws->getDevises();
|
|
$devises = $devisesReponse->result->item;
|
|
|
|
//Mise en session
|
|
$session = new SessionEntreprise($siret, $id, true);
|
|
$session->setInfoEntrep($infos);
|
|
|
|
$sessionSaisie = new Zend_Session_Namespace('saisie');
|
|
$sessionSaisie->tabSaisie['tribunal'] = $infos->TribunalCode;
|
|
|
|
$this->view->assign('selectPays', $this->selectPays);
|
|
|
|
$this->view->assign('siret', $siret);
|
|
$this->view->assign('id', $id);
|
|
$this->view->assign('devises', $devises);
|
|
$this->view->assign('etab', $infos);
|
|
}
|
|
|
|
/**
|
|
* Sauvegarde des informations de saisie
|
|
* @todo : Sauvegarder en mémoire la saisie
|
|
*/
|
|
public function saveAction()
|
|
{
|
|
//$this->_helper->layout()->disableLayout();
|
|
//$this->_helper->viewRenderer->setNoRender(true);
|
|
|
|
$request = $this->getRequest();
|
|
|
|
$siret = $request->getParam('siret');
|
|
$id = $request->getParam('id', 0);
|
|
|
|
$tabSaisie = $request->getParam('frmSaisie');
|
|
$tabJugement = $request->getParam('jugement');
|
|
$tabActionna = $request->getParam('actionnaire');
|
|
$tabParticip = $request->getParam('particip');
|
|
$tabScore = $request->getParam('score');
|
|
$perimetreVente = $request->getParam('perimetreVente');
|
|
$etablissement5500 = $request->getParam('etablissement5500');
|
|
$etabnic = $request->getParam('etabnic');
|
|
|
|
//Vente et Cession evénement 5500
|
|
if ($perimetreVente!=null){
|
|
foreach($perimetreVente as $k => $p){
|
|
if ( $p=='-' ){
|
|
array_splice($perimetreVente, $k, 1);
|
|
}
|
|
}
|
|
if ( isset($perimetreVente) && count($perimetreVente)>0 ){
|
|
$tabJugement['even'] = array_merge(
|
|
$tabJugement['even'],
|
|
$perimetreVente);
|
|
}
|
|
}
|
|
//Liste établissements concernées
|
|
if ( $etablissement5500!=null && count($etablissement5500)>0 ) {
|
|
$countEtab = 0;
|
|
$txtEtab = '';
|
|
foreach($etablissement5500 as $etab){
|
|
$txtEtab.= $etab;
|
|
$countEtab++;
|
|
if($countEtab>10) break;
|
|
if( count($etablissement5500) > $countEtab )
|
|
{ $txtEtab.=', '; }
|
|
}
|
|
|
|
if ( count($etablissement5500)>1 ){
|
|
$txt = 'Etablissement(s) concerné(s) : ';
|
|
} else {
|
|
$txt = 'Etablissement concerné : ';
|
|
}
|
|
|
|
if ( $tabJugement['comp']!='' ) {
|
|
$tabJugement['comp'].= ' '.$txt.$txtEtab;
|
|
} else {
|
|
$tabJugement['comp'] = ' '.$txt.$txtEtab;
|
|
}
|
|
}
|
|
|
|
//Sélection nic pour établissement concerné
|
|
if ( $etabnic!=null && $etabnic != '' ) {
|
|
if ( isset($txtEtab) && $txtEtab!='' ) {
|
|
$tabJugement['comp'].= ', '.$etabnic;
|
|
} else {
|
|
$tabJugement['comp'].= 'Etablissement concerné : '.$etabnic;
|
|
}
|
|
}
|
|
|
|
//Opposition à l'adresse
|
|
if ( $tabJugement['oppo'] == 'adresse' ) {
|
|
if ( $tabJugement['comp']!='' ) {
|
|
$tabJugement['comp'].= ' Opposition : A l\'adresse du bien vendu';
|
|
} else {
|
|
$tabJugement['comp'] = 'Opposition : A l\'adresse du bien vendu';
|
|
}
|
|
}
|
|
|
|
$identite = new stdClass();
|
|
$identite->isin = $tabSaisie['isin'];
|
|
$identite->tel = $tabSaisie['tel'];
|
|
$identite->fax = $tabSaisie['fax'];
|
|
$identite->web = $tabSaisie['web'];
|
|
$identite->mail = $tabSaisie['mail'];
|
|
$identite->activite = $tabSaisie['activite'];
|
|
$identite->sirenDoublon = $tabSaisie['sirenDoublon'];
|
|
$identite->waldec = $tabSaisie['waldec'];
|
|
$identite->moisOppositionInsee = $tabSaisie['moisOppositionInsee'];
|
|
$identite->moisRefusRCS = $tabSaisie['moisRefusRCS'];
|
|
$identite->domiciliataire = $tabSaisie['domiciliataire'];
|
|
|
|
$jugement = new stdClass();
|
|
$jugement->source = $tabJugement['source'];
|
|
$jugement->dateJuge = $tabJugement['dateJuge'];
|
|
$jugement->tribunal = $tabJugement['tribunal'];
|
|
$jugement->even = array();
|
|
if (count($tabJugement['even']>0)){
|
|
foreach ( $tabJugement['even'] as $even ){
|
|
$codeEven = new stdClass();
|
|
$codeEven->code = $even;
|
|
$jugement->even[] = $codeEven;
|
|
}
|
|
}
|
|
$jugement->admin = $tabJugement['admin'];
|
|
$jugement->mand = $tabJugement['mand'];
|
|
$jugement->oppo = $tabJugement['oppo'];
|
|
$jugement->dateParution = $tabJugement['dateParution'];
|
|
$jugement->numParution = $tabJugement['numParution'];
|
|
$jugement->montant = $tabJugement['montant'];
|
|
$jugement->actionsMt = $tabJugement['actionsMt'];
|
|
$jugement->actionsNb = $tabJugement['actionsNb'];
|
|
$jugement->nic = $tabJugement['nic'];
|
|
$jugement->datePaie = $tabJugement['datePaie'];
|
|
$jugement->dateFinPeriode = $tabJugement['dateFinPeriode'];
|
|
$jugement->comp = $tabJugement['comp'];
|
|
$jugement->nouvAdrCp = $tabJugement['nouvAdrCp'];
|
|
$jugement->nouvAdr = $tabJugement['nouvAdr'];
|
|
$jugement->nouvAdrVille = $tabJugement['nouvAdrVille'];
|
|
$jugement->nouvActivite = $tabJugement['nouvActivite'];
|
|
$jugement->nouvFJ = $tabJugement['nouvFJ'];
|
|
$jugement->nouvDir = array();
|
|
if (count($tabJugement['nouvDir'])>0){
|
|
foreach ( $tabJugement['nouvDir'] as $dir ){
|
|
$nouvDir = new stdClass();
|
|
$nouvDir->Fonc = $dir['Fonc'];
|
|
$nouvDir->Genre = $dir['Genre'];
|
|
$nouvDir->Pre = $dir['Pre'];
|
|
$nouvDir->Nom = $dir['Nom'];
|
|
$nouvDir->Dom = $dir['Dom'];
|
|
$jugement->nouvDir[] = $nouvDir;
|
|
}
|
|
}
|
|
$actionnaire = new stdClass();
|
|
$actionnaire->siren = $tabActionna['siren'];
|
|
$actionnaire->pct = $tabActionna['pct'];
|
|
$actionnaire->majMin = $tabActionna['majMin'];
|
|
$actionnaire->dateMAJ = $tabActionna['dateMAJ'];
|
|
$actionnaire->pays = $tabActionna['pays'];
|
|
$actionnaire->nom = $tabActionna['nom'];
|
|
|
|
$participation = new stdClass();
|
|
$participation->siren = $tabParticip['siren'];
|
|
$participation->pct = $tabParticip['pct'];
|
|
$participation->majMin = $tabParticip['majMin'];
|
|
$participation->dateMAJ = $tabParticip['dateMAJ'];
|
|
$participation->pays = $tabParticip['pays'];
|
|
$participation->nom = $tabParticip['nom'];
|
|
|
|
$score = new stdClass();
|
|
$score->encours = $tabScore['encours'];
|
|
$score->scoreSolv = $tabScore['scoreSolv'];
|
|
$score->scoreDir = $tabScore['scoreDir'];
|
|
$score->scoreConf = $tabScore['scoreConf'];
|
|
|
|
$tabInfos = new stdClass();
|
|
$tabInfos->identite = $identite;
|
|
$tabInfos->jugement = $jugement;
|
|
$tabInfos->actionnaire = $actionnaire;
|
|
$tabInfos->participation = $participation;
|
|
$tabInfos->scores = $tabScore;
|
|
|
|
|
|
$ws = new WsScores();
|
|
$O = $ws->setInfosEntrep($siret, $id, $tabInfos);
|
|
|
|
//Enregistrement en session pour saisie supplémentaire ou lors d'erreur
|
|
$tabSaisie = array(
|
|
'source' => $tabJugement['source'],
|
|
'dateParution' => $tabJugement['dateParution'],
|
|
'numParution' => $tabJugement['numParution']
|
|
);
|
|
|
|
$session = new Zend_Session_Namespace('saisie');
|
|
$session->tabSaisie = $tabSaisie;
|
|
|
|
if ($O->error->errNum!=0){
|
|
$message = 'Erreur lors de l\'enregistrement !';
|
|
$this->_helper->getHelper('Redirector')->setGotoSimple('fiche', 'saisie', null, array(
|
|
'siret' => $siret,
|
|
'id' => $id,
|
|
'message' => $message
|
|
));
|
|
} else {
|
|
$message = 'Saisie enregistrée !';
|
|
$this->view->assign('params', $request->getParams());
|
|
$this->view->assign('tabInfos', $tabInfos);
|
|
$this->view->assign('O', $O);
|
|
$this->view->assign('siret', $siret);
|
|
$this->view->assign('id', $id);
|
|
$this->view->assign('message', $message);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Retourne le formulaire bodacc
|
|
*/
|
|
public function formAction()
|
|
{
|
|
$request = $this->getRequest();
|
|
$siret = $request->getParam('siret');
|
|
$id = $request->getParam('id', 0);
|
|
|
|
$session = new SessionEntreprise($siret, $id);
|
|
|
|
$ws = new WsScores();
|
|
|
|
$reponse = $ws->getListeJalCollecte();
|
|
$listeJalCollecte = $reponse->result->item;
|
|
$this->view->assign('ListeJalCollecte', $listeJalCollecte);
|
|
|
|
if (Zend_Session::sessionExists()){
|
|
if(Zend_Session::namespaceIsset('saisie')){
|
|
$sessionSaisie = new Zend_Session_Namespace('saisie');
|
|
$saisie = $sessionSaisie->tabSaisie;
|
|
$this->view->assign('saisie', $saisie);
|
|
}
|
|
}
|
|
|
|
$eventNum = isset($saisie['eventNum']) ? $saisie['eventNum'] : '0000' ;
|
|
$this->view->assign('eventNum', $eventNum);
|
|
|
|
//Si le code tribunal n'est pas défini dans la fiche identité
|
|
//alors en sélectionner un par défault suivant le code INSEE
|
|
$tribunal = isset($saisie['tribunal']) ? $saisie['tribunal'] : '' ;
|
|
$this->view->assign('codeTribunalCmp', $tribunal);
|
|
|
|
$listeCompetences = array();
|
|
if ($tribunal=='') {
|
|
$siret = $session->getSiret();
|
|
$codeCommune = $session->getCodeCommune();
|
|
$reponse = $ws->getListeCompetences($siret, 'tri', $codeCommune);
|
|
$listeCompetences = $reponse->result->item;
|
|
}
|
|
$this->view->assign('ListeCompetences', $listeCompetences);
|
|
|
|
$reponse = $ws->getTribunaux( array('C','I','G','M','P') );
|
|
$listeTribunaux = array();
|
|
if (count($reponse->result->item)>0) {
|
|
foreach($reponse->result->item as $item) {
|
|
$listeTribunaux[$item->code] = $item->nom;
|
|
}
|
|
asort($listeTribunaux);
|
|
}
|
|
$this->view->assign('ListeTribunaux', $listeTribunaux);
|
|
asort($this->tabEvent);
|
|
$this->view->assign('tabEvent', $this->tabEvent);
|
|
$this->view->assign('siret', $siret);
|
|
}
|
|
|
|
/**
|
|
* Retourne le formulaire correspondant à l'évenement
|
|
*/
|
|
public function evenAction()
|
|
{
|
|
$request = $this->getRequest();
|
|
if ( $request->isPost() ){
|
|
$this->_helper->layout->disableLayout();
|
|
}
|
|
$num = $request->getParam('num', '0000');
|
|
$siren = $request->getParam('siren', '');
|
|
$nic = $request->getParam('nic', '');
|
|
$tribunal = $request->getParam('tribunal', '');
|
|
|
|
if (Zend_Session::sessionExists()){
|
|
/*if(Zend_Session::namespaceIsset('saisie')){
|
|
$sessionSaisie = new Zend_Session_Namespace('saisie');
|
|
$this->view->assign('saisie', $sessionSaisie->tabSaisie);
|
|
$num = $sessionSaisie->tabSaisie['eventNum'];
|
|
$tribunal = $sessionSaisie->tabSaisie['tribunal'];
|
|
$siren = substr($siren, 0, 9);
|
|
$nic = substr($siren, 9, 5);
|
|
}*/
|
|
}
|
|
|
|
switch($num) {
|
|
case '5500':
|
|
//Liste des établissements
|
|
$ws = new WsScores();
|
|
$reponse = $ws->getListeEtablissements($siren);
|
|
$listeEtablissements = $reponse->result->item;
|
|
$this->view->assign('ListeEtablissements', $listeEtablissements);
|
|
break;
|
|
case '6700':
|
|
//Liste des établissements
|
|
$ws = new WsScores();
|
|
$reponse = $ws->getListeEtablissements($siren);
|
|
$listeEtablissements = $reponse->result->item;
|
|
$this->view->assign('ListeEtablissements', $listeEtablissements);
|
|
//Assign constantes
|
|
$this->view->assign('selectDir', $this->selectDir);
|
|
$this->view->assign('selectGenre',$this->selectGenre);
|
|
break;
|
|
case '2202':
|
|
//Assign constantes
|
|
$this->view->assign('selectDir', $this->selectDir);
|
|
$this->view->assign('selectGenre',$this->selectGenre);
|
|
break;
|
|
}
|
|
$this->view->assign('siren', $siren);
|
|
$this->view->assign('nic', $nic);
|
|
$this->view->assign('tribunal', $tribunal);
|
|
$this->renderScript('saisie/even/'.$num.'.phtml');
|
|
}
|
|
|
|
/**
|
|
* Affiche un champ de formulaire
|
|
*/
|
|
public function champsAction()
|
|
{
|
|
$request = $this->getRequest();
|
|
$champ = $request->getParam('champ', '');
|
|
$this->renderScript('saisie/champs/'.$champ.'.phtml');
|
|
}
|
|
|
|
/**
|
|
* Retourne les informations de l'établissements
|
|
*/
|
|
public function etabnicAction()
|
|
{
|
|
$this->_helper->layout->disableLayout();
|
|
$this->_helper->viewRenderer->setNoRender();
|
|
|
|
$request = $this->getRequest();
|
|
$siret = $request->getParam('siret', '');
|
|
if($siret!='') {
|
|
$ws = new WsScores();
|
|
$etab = $ws->getIdentite($siret);
|
|
if($etab->Siret==$siret){
|
|
echo $etab->Adresse.' '.$etab->CP.' '.$etab->Ville.' ('. $etab->Nic.')';
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Retourne le formulaire d'opposition insee
|
|
*/
|
|
public function oppositioninseeAction()
|
|
{
|
|
$this->_helper->layout->disableLayout();
|
|
}
|
|
|
|
/**
|
|
* Retourne le formulaire de refus rncs
|
|
*/
|
|
public function refusrncsAction()
|
|
{
|
|
$this->_helper->layout->disableLayout();
|
|
}
|
|
|
|
/**
|
|
* Suppression / Copie et Edition des annonces
|
|
* @todo : Faire l'edition des annonces
|
|
*/
|
|
public function annonceAction()
|
|
{
|
|
$this->_helper->layout->disableLayout();
|
|
$this->_helper->viewRenderer->setNoRender();
|
|
|
|
$request = $this->getRequest();
|
|
$source = $request->getParam('source');
|
|
$op = $request->getParam('op');
|
|
|
|
switch($op)
|
|
{
|
|
case 'delete':
|
|
|
|
$siret = str_replace(' ', '', $request->getParam('siret'));
|
|
$idan = $request->getParam('idan');
|
|
|
|
$sourceNum = false;
|
|
$source = strtoupper($source);
|
|
if (in_array($source, array('BODA', 'BODB', 'BODC'))){
|
|
$sourceNum = 1;
|
|
} elseif ($source == 'BALO') {
|
|
$sourceNum = 2;
|
|
} elseif ($source == 'ASSO') {
|
|
$sourceNum = 3;
|
|
} elseif (in_array($source, array('BOMP A', 'BOMP B', 'BOMP C', 'MAPA'))) {
|
|
$sourceNum = 4;
|
|
} elseif (!empty($source)){
|
|
$sourceNum = 0;
|
|
}
|
|
|
|
if ($sourceNum === false) {
|
|
echo "Source inconnu"; exit;
|
|
}
|
|
|
|
$ws = new WsScores();
|
|
$reponse = $ws->supprAnnonce($sourceNum, $idan, $siret);
|
|
$error = $reponse->error;
|
|
if ( isset($error) && $error->errnum == 0 ){
|
|
$output = 'Annonce '.$idan.' supprimé !';
|
|
} elseif ( isset($error) && $error->errnum != 0 ) {
|
|
$output = 'Erreur lors de la suppression.';
|
|
} else {
|
|
$output = "Une erreur est survenue...";
|
|
}
|
|
echo $output;
|
|
|
|
break;
|
|
|
|
case 'copy':
|
|
|
|
$siretIn = $request->getParam('siretIn');
|
|
$siretOut = $request->getParam('siretOut');
|
|
$idan = $request->getParam('idan');
|
|
|
|
if ( intval($siretIn)!=0 )
|
|
{
|
|
$sourceNum = false;
|
|
$source = strtoupper($source);
|
|
if (in_array($source, array('BODA', 'BODB', 'BODC'))){
|
|
$sourceNum = 1;
|
|
} elseif ($source == 'BALO') {
|
|
$sourceNum = 2;
|
|
} elseif ($source == 'ASSO') {
|
|
$sourceNum = 3;
|
|
} elseif (in_array($source, array('BOMP A', 'BOMP B', 'BOMP C', 'MAPA'))) {
|
|
$sourceNum = 4;
|
|
} elseif (!empty($source)){
|
|
$sourceNum = 0;
|
|
}
|
|
if ($sourceNum === false) {
|
|
echo "Source inconnu"; exit;
|
|
}
|
|
$ws = new WsScores();
|
|
$reponse = $ws->dupliqueAnnonce($sourceNum, $idan, $siretIn, $siretOut);
|
|
$error = $reponse->error;
|
|
if ( isset($error) && $error->errnum == 0 ){
|
|
$output = 'Annonce '.$idan.' dupliqué sur '.$siretOut.'!';
|
|
} elseif ( isset($error) && $error->errnum != 0 ) {
|
|
$output = 'Erreur lors de la duplication.';
|
|
} else {
|
|
$output = "Une erreur est survenue...";
|
|
}
|
|
echo $output;
|
|
} else {
|
|
echo "!! Fiche avec siren à 000000000 !!";
|
|
}
|
|
break;
|
|
|
|
case 'edit':
|
|
|
|
//@todo : sauvegarder
|
|
|
|
$siret = $request->getParam('siret');
|
|
$idan = $request->getParam('idan');
|
|
|
|
print_r($request->getParams());
|
|
|
|
|
|
|
|
/*
|
|
echo saisie_save($siret, '', $tabInfo);
|
|
echo '<br/>';
|
|
|
|
*/
|
|
|
|
break;
|
|
|
|
case 'even':
|
|
|
|
$siret = $request->getParam('siret');
|
|
$idan = $request->getParam('idan');
|
|
$codeEven = $request->getParam('even');
|
|
$siren = substr($siret,0,9);
|
|
$ws = new WsScores();
|
|
$result = $ws->setAnnonceEven($siren, $idan, $codeEven);
|
|
if ($result===true) {
|
|
echo "Modification effectué";
|
|
} else {
|
|
echo "Erreur !";
|
|
}
|
|
|
|
break;
|
|
|
|
default:
|
|
echo 'Error !';
|
|
break;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Affiche le fomulaire d'edition/suppression/copie d'annonce
|
|
*/
|
|
public function annoncedialogAction()
|
|
{
|
|
$this->_helper->layout->disableLayout();
|
|
|
|
$request = $this->getRequest();
|
|
$siret = $request->getParam('siret');
|
|
$op = $request->getParam('op');
|
|
$idan = $request->getParam('idAnn');
|
|
$source = $request->getParam('code');
|
|
|
|
if ($op == 'edit')
|
|
{
|
|
$siret = $request->getParam('siret');
|
|
|
|
$siren = substr($siret,0,9);
|
|
$nic = substr($siret,10,5);
|
|
if ( !empty($idan) )
|
|
{
|
|
$ws = new WsScores();
|
|
$reponse = $ws->getAnnonceCollecte($idan, $siret);
|
|
|
|
if ($reponse->error->errnum>0)
|
|
{
|
|
$message = $reponse->error->errmsg;
|
|
$this->view->assign('message', $message);
|
|
}
|
|
else
|
|
{
|
|
$idanResult = $reponse->result;
|
|
//Limitation des événements
|
|
$eventLimits = array('5500');
|
|
foreach ( $eventLimits as $eventLimit )
|
|
{
|
|
$isEditable = false;
|
|
if (count($idanResult->even->item)>0){
|
|
foreach($idanResult->even->item as $even){
|
|
if ($eventLimit == $even->CodeEven){
|
|
$isEditable = true;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
if ( $isEditable && in_array($idanResult->source, array('JT', 'ANTE')))
|
|
{
|
|
//Mapper idanResult dans le tableau de saisie
|
|
$saisie = array(
|
|
'source' => isset($_SESSION['source']) ? $_SESSION['source'] : $idanResult->source,
|
|
'dateParution' => isset($_SESSION['dateParution']) ? $_SESSION['dateParution'] :
|
|
WDate::dateT('Y-m-d', 'd/m/Y', substr($idanResult->dateSource,0,10)),
|
|
'numParution' => isset($_SESSION['numParution']) ? $_SESSION['numParution'] : '',
|
|
'dateJugement' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult->dateEffetFinP),
|
|
'tribunal' => $idanResult->tribunal,
|
|
'even' => $idanResult->even->item,
|
|
'eventNum' => $eventLimit,
|
|
'comp' => $idanResult->complement,
|
|
'montant' => $idanResult->montant,
|
|
'dateFinPeriode' => WDate::dateT('Y-m-d', 'd/m/Y', $idanResult->dateJugement),
|
|
);
|
|
|
|
$intervenants = array();
|
|
for ( $i=0 ; $i<3 ; $i++ ) {
|
|
$intervenants[$i] = array(
|
|
'type' => $idanResult->{'inter'.($i+1).'type'},
|
|
'id' => $idanResult->{'inter'.($i+1).'id'},
|
|
'nom' => $idanResult->{'inter'.($i+1).'nom'},
|
|
);
|
|
}
|
|
|
|
$sessionSaisie = new Zend_Session_Namespace('saisie');
|
|
$sessionSaisie->tabSaisie = $saisie;
|
|
|
|
//require_once realpath(dirname(__FILE__)).'/constantes.php';
|
|
//require_once realpath(dirname(__FILE__)).'/saisie_form_event.php';
|
|
break;
|
|
} else {
|
|
$message = "Source : ".$idanResult->source."<br/>";
|
|
$message.= "Evénement(s) non éditable : <br/>";
|
|
foreach($idanResult->even->item as $even){
|
|
$message.= $even->CodeEven." - ".$this->tabEvent[$even->CodeEven]."<br/>";
|
|
}
|
|
$this->view->assign('message', $message);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
elseif ($op == 'even')
|
|
{
|
|
asort($this->tabEvent);
|
|
$this->view->assign('evens', $this->tabEvent);
|
|
}
|
|
|
|
$this->view->assign('op', $op);
|
|
$this->view->assign('idan', $idan);
|
|
$this->view->assign('source', $source);
|
|
$this->view->assign('siret', $siret);
|
|
}
|
|
|
|
public function acteAction()
|
|
{
|
|
|
|
|
|
}
|
|
} |