[ Index ] |
|
Code source de SPIP Agora 1.4 |
1 <?php 2 /***************************************************** 3 * This file is part of Agora, web based content management system. 4 * 5 * Agora is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * Agora is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details (file "COPYING"). 13 * 14 * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière. 15 * List of authors detailed in "copyright_fr.html" file. 16 * E-mail : agora@sig.premier-ministre.gouv.fr 17 * Web site : http://www.agora.gouv.fr 18 *****************************************************/ 19 //define (SPACESIZE, 20); 20 21 include ("inc.php"); 22 23 include_ecrire ("inc_mots.php"); 24 25 require_once (dirname(__FILE__). "/include/bd/inc_newsletter_instance_factory.php"); 26 require_once (dirname(__FILE__). "/include/bd/inc_cm_user_groups_factory.php"); 27 require_once (dirname(__FILE__). "/inc_newsletter_constants.php"); 28 require_once (dirname(__FILE__). "/inc_draw_api.php"); 29 30 $newsletterInstanceMetier = &recuperer_instance_newsletter_instance(); 31 32 $loadOK = $result = $newsletterInstanceMetier->load($id_post); 33 34 if (PEAR::isError($loadOK)) { 35 die ($loadOK->getMessage()); 36 } 37 38 if ($modifDestinataireSpecifique) { 39 $newsletterInstanceMetier->setDestinatairesSpecifiques($destinataires_specifiques); 40 $updateOK = $newsletterInstanceMetier->update(); 41 if (PEAR::isError($updateOK)) { 42 die ($updateOK->getMessage()); 43 } 44 } 45 46 $destinatairesSpecifiques = $newsletterInstanceMetier->getDestinatairesSpecifiques(); 47 48 $id = $newsletterInstanceMetier->getId(); 49 $titreNLInstance = $newsletterInstanceMetier->getSubject(); 50 51 //Gestion des groupes utilisateurs 52 if ($modifier_groupe == 'oui') { 53 if ($ancien_titre) { 54 $authorization = &recuperer_instance_authorization('modifierCMuserGroupeInstance', 55 $GLOBALS['connect_id_auteur']); 56 if ($authorization->isAuthorizedAction()) { 57 $cmUserGroupsMetier = &recuperer_instance_cm_user_groups(); 58 $loadOK = $cmUserGroupsMetier->load($id_groupe); 59 if (PEAR::isError($loadOK)) { 60 die ($loadOK->getMessage()); 61 } 62 else { 63 $cmUserGroupsMetier->setTitre($titre); 64 $updateOK = $cmUserGroupsMetier->update(); 65 if (PEAR::isError($updateOK)) { 66 die ($updateOK->getMessage()); 67 } 68 } 69 } 70 } 71 else { 72 $cmUserGroupsMetier = &recuperer_instance_cm_user_groups(); 73 $cmUserGroupsMetier->setTitre($titre); 74 $cmUserGroupsMetier->setLstId(0); 75 $cmUserGroupsMetier->setPstId($id_post); 76 $createOK = $cmUserGroupsMetier->create(); 77 if (PEAR::isError($createOK)) { 78 die ($createOK->getMessage()); 79 } 80 } 81 } 82 83 //Persistence sur les groupes 84 85 // 86 87 debut_page("« $titreNLInstance »", "administration", "newsletter"); 88 // Ajout Olivier Mansour 89 // gestion des authorizations 90 $authorization = &recuperer_instance_authorization('envoyerLettresInfos', $GLOBALS['connect_id_auteur']); 91 92 if (!$authorization->isAuthorizedAction()) { 93 echo _T('avis_non_acces_page'); 94 fin_page(); 95 exit; 96 } 97 98 // fin ajout 99 debut_gauche(); 100 101 debut_boite_info(); 102 echo "<div align='center'>\n"; 103 echo "<font face='Verdana,Arial,Helvetica,sans-serif' size='1'><b>LETTRE D'INFORMATION NUMÉRO :</b></font>\n"; 104 echo "<br><font face='Verdana,Arial,Helvetica,sans-serif' size='6'><b>$id_newsletter</b></font>\n"; 105 icone_horizontale(_T('retour_info_gabarit'), "postinfo.php?retour=nav&id_newsletter=$id_newsletter&id_post=$id_post", 106 "newsletter-24.gif", "rien.gif"); 107 108 echo "</div>"; 109 fin_boite_info(); 110 111 debut_droite(); 112 debut_cadre_relief ("newsletter-24.gif"); 113 echo "\n<table cellpadding=0 cellspacing=0 border=0 width='100%'>"; 114 echo "<tr width='100%'><td width='100%' valign='top'>"; 115 gros_titre ($titreNLInstance); 116 echo "</td>"; 117 118 echo "<td><img src='img_pack/rien.gif' width=5></td>\n"; 119 echo "<td align='right' valign='top'>"; 120 icone(_T('creer_groupe_nl'), "post_admin_group_edit.php?id_post=$id_post&id_newsletter=$id_newsletter&new=oui", 121 "redacteurs-24.gif", "edit.gif"); 122 echo "</td>"; 123 echo "</tr>\n"; 124 125 echo "<tr><td colspan=3>\n"; 126 127 debut_cadre_enfonce ("redacteurs-24.gif"); 128 echo "<p><table border=0 width='100%'>"; 129 echo "<tr><td bgcolor='$couleur_foncee'><font face='Verdana,Arial,Helvetica,sans-serif' size=3 color='#ffffff'><b>les destinataires spécifiques :</b>"; 130 echo "</font></td>"; 131 echo "<tr>"; 132 echo "<td align='center'>"; 133 echo '<form action=\'post_admin_groups.php?id_post=' . $id_post . '&id_newsletter=' . $id_newsletter . '\' method=\'post\'>'; 134 echo '<textarea cols=\'45\' name=\'destinataires_specifiques\'>'; 135 echo $destinatairesSpecifiques; 136 echo '</textarea>'; 137 echo "</td>"; 138 echo "</tr>"; 139 echo "<tr>"; 140 echo "<td align='center'>"; 141 echo "<input type='submit' value=' " . _T( 142 'bouton_valider'). "' class='fondo' STYLE='font-size:10px' name='modifDestinataireSpecifique'>"; 143 echo '</form>'; 144 echo "</td>"; 145 echo "</tr></table>"; 146 fin_cadre_enfonce(); 147 148 $cmUserGroupsMetier = &recuperer_instance_cm_user_groups(); 149 $allCMuserGroupsForPostId = $cmUserGroupsMetier->getAllUserGroupsForPostId($id_post); 150 $i = 0; 151 152 while (list(, $myCMUserGroup) = each($allCMuserGroupsForPostId)) { 153 debut_cadre_enfonce ("redacteurs-24.gif"); 154 echo "<p><table border=0 cellspacing=0 cellpadding=3 width=\"100%\">"; 155 echo "<tr><td bgcolor='$couleur_foncee' colspan=2><font face='Verdana,Arial,Helvetica,sans-serif' size=3 color='#ffffff'><b>" . $myCMUserGroup->getTitre(). "</b>"; 156 echo "</font></td>"; 157 echo "<tr><td colspan=3><font face='Verdana,Arial,Helvetica,sans-serif' size=1>"; 158 echo "</font></td></tr>"; 159 160 echo "<tr>"; 161 echo "<td align='left' valign='top'>"; 162 echo icone(_T('modifier_groupe_nl'), 163 "post_admin_group_edit.php?id_post=$id_post&id_newsletter=$id_newsletter&id_groupe=" . $myCMUserGroup->getGroupeId(), 164 "redacteurs-24.gif", 165 "edit.gif"); 166 echo "</td>"; 167 echo "<td align='right' valign='top'>"; 168 169 if ($id_groupe == $myCMUserGroup->getGroupeId()) { 170 formulaire_mots('cm_specifique', $myCMUserGroup->getGroupeId(), $nouv_mot, $supp_mot, $cherche_mot, true, $i++); 171 } 172 else { 173 formulaire_mots('cm_specifique', $myCMUserGroup->getGroupeId(), null, null, null, true, $i++); 174 } 175 176 echo "</td>"; 177 178 echo "</tr></table>"; 179 fin_cadre_enfonce(); 180 } 181 182 echo "</td></tr>\n"; 183 echo "</table>\n"; 184 185 fin_cadre_relief(); 186 187 fin_page(); 188 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |