| Line 17... |
Line 17... |
| 17 |
// | |
|
17 |
// | |
|
| 18 |
// | You should have received a copy of the GNU Lesser General Public |
|
18 |
// | You should have received a copy of the GNU Lesser General Public |
|
| 19 |
// | License along with this library; if not, write to the Free Software |
|
19 |
// | License along with this library; if not, write to the Free Software |
|
| 20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
20 |
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
| 21 |
// +------------------------------------------------------------------------------------------------------+
|
21 |
// +------------------------------------------------------------------------------------------------------+
|
| 22 |
// CVS : $Id: adsi_site.fonct.php,v 1.26 2006-03-02 10:49:49 ddelon Exp $
|
22 |
// CVS : $Id: adsi_site.fonct.php,v 1.27 2006-03-15 23:35:25 ddelon Exp $
|
| 23 |
/**
|
23 |
/**
|
| 24 |
* Bibliothèque de fonctions d'admininistration des projets
|
24 |
* Bibliothèque de fonctions d'admininistration des projets
|
| 25 |
*
|
25 |
*
|
| 26 |
* Contient un ensemble de fonctions permettant à l'application Administrateur de Papyrus, de modifier des informations
|
26 |
* Contient un ensemble de fonctions permettant à l'application Administrateur de Papyrus, de modifier des informations
|
| 27 |
* sur les projets (=sites gérés par Papyrus).
|
27 |
* sur les projets (=sites gérés par Papyrus).
|
| Line 32... |
Line 32... |
| 32 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
32 |
*@author Jean-Pascal MILCENT <jpm@tela-botanica.org>
|
| 33 |
//Autres auteurs :
|
33 |
//Autres auteurs :
|
| 34 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
34 |
*@author Alexandre GRANIER <alexandre@tela-botanica.org>
|
| 35 |
*@author Laurent COUDOUNEAU <lc@gsite.org>
|
35 |
*@author Laurent COUDOUNEAU <lc@gsite.org>
|
| 36 |
*@copyright Tela-Botanica 2000-2004
|
36 |
*@copyright Tela-Botanica 2000-2004
|
| 37 |
*@version $Revision: 1.26 $ $Date: 2006-03-02 10:49:49 $
|
37 |
*@version $Revision: 1.27 $ $Date: 2006-03-15 23:35:25 $
|
| 38 |
// +------------------------------------------------------------------------------------------------------+
|
38 |
// +------------------------------------------------------------------------------------------------------+
|
| 39 |
*/
|
39 |
*/
|
| Line 40... |
Line 40... |
| 40 |
|
40 |
|
| 41 |
// +------------------------------------------------------------------------------------------------------+
|
41 |
// +------------------------------------------------------------------------------------------------------+
|
| Line 223... |
Line 223... |
| 223 |
$aso_options[$ligne_traduction->gs_id_site] = ' '.$ligne_traduction->gs_ce_i18n.": ".htmlentities($ligne_traduction->gs_nom.' ('.$ligne_traduction->gs_code_alpha.')');
|
223 |
$aso_options[$ligne_traduction->gs_id_site] = ' '.$ligne_traduction->gs_ce_i18n.": ".htmlentities($ligne_traduction->gs_nom.' ('.$ligne_traduction->gs_code_alpha.')');
|
| 224 |
}
|
224 |
}
|
| 225 |
$resultat_traduction->free();
|
225 |
$resultat_traduction->free();
|
| Line 226... |
Line 226... |
| 226 |
|
226 |
|
| 227 |
}
|
- |
|
| Line 228... |
Line 227... |
| 228 |
$resultat->free();
|
227 |
}
|
| 229 |
|
228 |
|
| 230 |
$id = 'form_sites_id_site';
|
229 |
$id = 'form_sites_id_site';
|
| 231 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
230 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
| Line 311... |
Line 310... |
| 311 |
$aso_valeurs['type_site_externe'] = 0;
|
310 |
$aso_valeurs['type_site_externe'] = 0;
|
| 312 |
// Nous cherchons à savoir si nous somme en modification
|
311 |
// Nous cherchons à savoir si nous somme en modification
|
| 313 |
if ((isset($aso_valeurs['form_sites_modifier'])) || (isset($aso_valeurs['form_sites_traduire']))) {
|
312 |
if ((isset($aso_valeurs['form_sites_modifier'])) || (isset($aso_valeurs['form_sites_traduire']))) {
|
| 314 |
if ((isset($aso_valeurs['form_sites_modifier']))) {
|
313 |
if ((isset($aso_valeurs['form_sites_modifier']))) {
|
| 315 |
$as_val['modification'] = true;
|
314 |
$as_val['modification'] = true;
|
| - |
|
315 |
$as_val['traduction'] = false;
|
| 316 |
}
|
316 |
}
|
| 317 |
else {
|
317 |
else {
|
| 318 |
$as_val['traduction'] = true;
|
318 |
$as_val['traduction'] = true;
|
| - |
|
319 |
$as_val['modification'] = false;
|
| 319 |
};
|
320 |
}
|
| Line 320... |
Line 321... |
| 320 |
|
321 |
|
| 321 |
if ($as_val['traduction']) {
|
322 |
if ($as_val['traduction']) {
|
| Line 322... |
Line 323... |
| 322 |
// Traduction d'un site principal uniquement :
|
323 |
// Traduction d'un site principal uniquement :
|
| Line 380... |
Line 381... |
| 380 |
}
|
381 |
}
|
| 381 |
$resultat->free();
|
382 |
$resultat->free();
|
| Line 382... |
Line 383... |
| 382 |
|
383 |
|
| 383 |
if (($as_val['modification'])) {
|
384 |
if (($as_val['modification'])) {
|
| - |
|
385 |
$aso_valeurs['modification'] = true;
|
| 384 |
$aso_valeurs['modification'] = true;
|
386 |
$aso_valeurs['traduction'] = false;
|
| 385 |
}
|
387 |
}
|
| 386 |
else {
|
388 |
else {
|
| - |
|
389 |
$aso_valeurs['traduction'] = true;
|
| 387 |
$aso_valeurs['traduction'] = true;
|
390 |
$aso_valeurs['modification'] = false;
|
| Line 388... |
Line 391... |
| 388 |
};
|
391 |
};
|
| Line 471... |
Line 474... |
| 471 |
}
|
474 |
}
|
| 472 |
$resultat->free();
|
475 |
$resultat->free();
|
| 473 |
$id = 'gs_ce_auth';
|
476 |
$id = 'gs_ce_auth';
|
| 474 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
477 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
| 475 |
$label = '<label for="'.$id.'">'.'Identification : '.'</label>';
|
478 |
$label = '<label for="'.$id.'">'.'Identification : '.'</label>';
|
| 476 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
479 |
$s = &$form->createElement('select', $id , $label, "", $aso_attributs);
|
| - |
|
480 |
$s->loadArray($aso_options,$aso_valeurs['gs_ce_auth']);
|
| - |
|
481 |
$form->addElement($s);
|
| - |
|
482 |
|
| Line 477... |
Line 483... |
| 477 |
|
483 |
|
| 478 |
// En modification nous affichons la liste des squelettes disponibles dans
|
484 |
// En modification nous affichons la liste des squelettes disponibles dans
|
| 479 |
// le dossier du site.
|
485 |
// le dossier du site.
|
| 480 |
if ($aso_valeurs['modification'] || $aso_valeurs['traduction']) {
|
486 |
if ($aso_valeurs['modification'] || $aso_valeurs['traduction']) {
|
| Line 527... |
Line 533... |
| 527 |
}
|
533 |
}
|
| Line 528... |
Line 534... |
| 528 |
|
534 |
|
| 529 |
$id = 'gs_fichier_squelette';
|
535 |
$id = 'gs_fichier_squelette';
|
| 530 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
536 |
$aso_attributs = array('id'=> $id, 'tabindex' => $tab_index++);
|
| 531 |
$label = '<label for="'.$id.'">'.'Squelette : '.'</label>';
|
537 |
$label = '<label for="'.$id.'">'.'Squelette : '.'</label>';
|
| - |
|
538 |
$s = &$form->createElement('select', $id , $label, "", $aso_attributs);
|
| - |
|
539 |
$s->loadArray($aso_options,$aso_valeurs['gs_fichier_squelette']);
|
| - |
|
540 |
$form->addElement($s);
|
| 532 |
$form->addElement('select', $id, $label, $aso_options, $aso_attributs);
|
541 |
|
| Line 533... |
Line 542... |
| 533 |
}
|
542 |
}
|
| Line 534... |
Line 543... |
| 534 |
|
543 |
|
| Line 1699... |
Line 1708... |
| 1699 |
}
|
1708 |
}
|
| 1700 |
$message = '<p class="pap_info">Succés de la suppression du site.</p>';
|
1709 |
$message = '<p class="pap_info">Succés de la suppression du site.</p>';
|
| 1701 |
return $message;
|
1710 |
return $message;
|
| 1702 |
}
|
1711 |
}
|
| Line -... |
Line 1712... |
| - |
|
1712 |
|
| - |
|
1713 |
|
| - |
|
1714 |
function ADMIN_verifier_traduction_possible(&$db, $aso_valeurs) {
|
| - |
|
1715 |
|
| - |
|
1716 |
|
| - |
|
1717 |
// Traduction d'un site principal uniquement :
|
| - |
|
1718 |
|
| - |
|
1719 |
$requete = 'SELECT gsr_id_site_01, gs_ce_i18n '.
|
| - |
|
1720 |
'FROM gen_site_relation, gen_site '.
|
| - |
|
1721 |
'WHERE gsr_id_site_02 = '.$aso_valeurs['form_sites_id_site'].' '.
|
| - |
|
1722 |
'AND gs_id_site = gsr_id_site_01 '.
|
| - |
|
1723 |
'AND gsr_id_valeur =1 '; // 1 = "avoir traduction"
|
| - |
|
1724 |
|
| - |
|
1725 |
$resultat = $db->query($requete);
|
| - |
|
1726 |
|
| - |
|
1727 |
if (DB::isError($resultat)) {
|
| - |
|
1728 |
die( BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete) );
|
| - |
|
1729 |
}
|
| - |
|
1730 |
|
| - |
|
1731 |
if ( $resultat->numRows() == 0 ) {
|
| - |
|
1732 |
$site_id = $aso_valeurs['form_sites_id_site'];
|
| - |
|
1733 |
}
|
| - |
|
1734 |
else {
|
| - |
|
1735 |
$ligne_site = $resultat->fetchRow(DB_FETCHMODE_OBJECT);
|
| - |
|
1736 |
$site_id = $ligne_site->gsr_id_site_01;
|
| - |
|
1737 |
}
|
| - |
|
1738 |
|
| - |
|
1739 |
|
| - |
|
1740 |
$requete = 'SELECT distinct gs_ce_i18n '.
|
| - |
|
1741 |
'FROM gen_site_relation, gen_site '.
|
| - |
|
1742 |
'WHERE gsr_id_site_01 = ' . $site_id .' '.
|
| - |
|
1743 |
'AND gs_id_site = gsr_id_site_02 '.
|
| - |
|
1744 |
'AND gsr_id_valeur =1 '; // 1 = "avoir traduction"
|
| - |
|
1745 |
|
| - |
|
1746 |
$resultat = $db->query($requete) ;
|
| - |
|
1747 |
if (DB::isError($resultat)) {
|
| - |
|
1748 |
die( BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete) );
|
| - |
|
1749 |
}
|
| - |
|
1750 |
$not_in_langue='';
|
| - |
|
1751 |
if ( $resultat->numRows() == 0 ) {
|
| - |
|
1752 |
$not_in_langue="gi_id_i18n not in('".$ligne_site->gs_ce_i18n."')";
|
| - |
|
1753 |
}
|
| - |
|
1754 |
else {
|
| - |
|
1755 |
while ($ligne = $resultat->fetchRow(DB_FETCHMODE_OBJECT)) {
|
| - |
|
1756 |
$not_in_langue="'".$ligne->gs_ce_i18n."'".",".$not_in_langue;
|
| - |
|
1757 |
$end="'".$ligne->gs_ce_i18n."'";
|
| - |
|
1758 |
}
|
| - |
|
1759 |
$not_in_langue=' gi_id_i18n not in('.$not_in_langue.$end.')';
|
| - |
|
1760 |
}
|
| - |
|
1761 |
$resultat->free();
|
| - |
|
1762 |
|
| - |
|
1763 |
$requete = "SELECT * FROM gen_i18n where ".$not_in_langue;
|
| - |
|
1764 |
|
| - |
|
1765 |
$resultat = $db->query($requete) ;
|
| - |
|
1766 |
if (DB::isError($resultat)) {
|
| - |
|
1767 |
die( BOG_afficherErreurSql(__FILE__, __LINE__, $resultat->getMessage(), $requete) );
|
| - |
|
1768 |
}
|
| - |
|
1769 |
|
| - |
|
1770 |
$retour = $resultat->numRows();
|
| - |
|
1771 |
$resultat->free();
|
| - |
|
1772 |
|
| - |
|
1773 |
$message='';
|
| - |
|
1774 |
if ($retour == 0) {
|
| - |
|
1775 |
$message = '<p class="pap_erreur">Plus de traduction possible pour ce site </p>';
|
| - |
|
1776 |
}
|
| - |
|
1777 |
return $message;
|
| - |
|
1778 |
}
|
| 1703 |
|
1779 |
|
| 1704 |
// +- Fin du code source --------------------------------------------------------------------------------+
|
1780 |
// +- Fin du code source --------------------------------------------------------------------------------+
|
| 1705 |
/*
|
1781 |
/*
|
| - |
|
1782 |
* $Log: not supported by cvs2svn $
|
| - |
|
1783 |
* Revision 1.26 2006/03/02 10:49:49 ddelon
|
| - |
|
1784 |
* Fusion branche multilinguisme dans branche principale
|
| 1706 |
* $Log: not supported by cvs2svn $
|
1785 |
*
|
| 1707 |
* Revision 1.25.2.2 2006/02/28 14:02:10 ddelon
|
1786 |
* Revision 1.25.2.2 2006/02/28 14:02:10 ddelon
|
| 1708 |
* Finition multilinguisme
|
1787 |
* Finition multilinguisme
|
| 1709 |
*
|
1788 |
*
|
| 1710 |
* Revision 1.25.2.1 2006/01/19 21:26:20 ddelon
|
1789 |
* Revision 1.25.2.1 2006/01/19 21:26:20 ddelon
|