1865 |
$sql = "SELECT dossier.dossier as dossier, |
$sql = "SELECT dossier.dossier as dossier, |
1866 |
dossier_autorisation.dossier_autorisation as dossier_autorisation, |
dossier_autorisation.dossier_autorisation as dossier_autorisation, |
1867 |
to_char(dossier.date_demande, 'YYYY/MM') as date_demande_initiale, |
to_char(dossier.date_demande, 'YYYY/MM') as date_demande_initiale, |
|
dossier.version as version, |
|
1868 |
dossier_instruction_type.code as dossier_instruction_type, |
dossier_instruction_type.code as dossier_instruction_type, |
1869 |
etat_dossier_autorisation.libelle as statut, |
etat_dossier_autorisation.libelle as statut, |
1870 |
dossier_autorisation_type.code as dossier_autorisation_type, |
dossier_autorisation_type.code as dossier_autorisation_type, |
1894 |
|
|
1895 |
//Si il y a un résultat |
//Si il y a un résultat |
1896 |
if ($row !== null) { |
if ($row !== null) { |
1897 |
|
|
1898 |
|
//Génération du numéro de version |
1899 |
|
$sql = "SELECT |
1900 |
|
count(*) |
1901 |
|
FROM |
1902 |
|
".DB_PREFIXE."dossier |
1903 |
|
LEFT JOIN |
1904 |
|
".DB_PREFIXE."dossier_autorisation |
1905 |
|
ON |
1906 |
|
dossier_autorisation.dossier_autorisation = dossier.dossier_autorisation |
1907 |
|
LEFT JOIN |
1908 |
|
".DB_PREFIXE."dossier_instruction_type |
1909 |
|
ON |
1910 |
|
dossier_instruction_type.dossier_instruction_type = dossier.dossier_instruction_type |
1911 |
|
WHERE |
1912 |
|
dossier_autorisation.dossier_autorisation = '".$row['dossier_autorisation']."' |
1913 |
|
AND |
1914 |
|
dossier_instruction_type.code = '".$row['dossier_instruction_type']."'"; |
1915 |
|
$row['version'] = $this->db->getOne($sql); |
1916 |
|
$this->f->addToLog("getSpecificMetadata(): db->getOne(\"".$sql."\")", VERBOSE_MODE); |
1917 |
|
if ( database::isError($row['version'])){ |
1918 |
|
$this->f->addToError("", $row['version'], $row['version']); |
1919 |
|
return false; |
1920 |
|
} |
1921 |
|
|
1922 |
|
//Formatage du numéro de version |
1923 |
|
$row['version'] = str_pad($row['version'], 2, "0", STR_PAD_LEFT); |
1924 |
|
|
1925 |
//Alors on créé l'objet dossier_instruction |
//Alors on créé l'objet dossier_instruction |
1926 |
$this->specificMetadata = $row; |
$this->specificMetadata = $row; |