Subversion Repositories Applications.bazar

Rev

Rev 371 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 371 Rev 381
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: bazar.fonct.rss.php,v 1.99.2.10 2008-02-04 13:03:09 alexandre_tb Exp $
22
// CVS : $Id: bazar.fonct.rss.php,v 1.99.2.11 2008-03-17 11:03:02 jp_milcent Exp $
23
/**
23
/**
24
* 
24
* 
25
*@package bazar
25
*@package bazar
26
//Auteur original :
26
//Auteur original :
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
27
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
28
*@author        Florian Schmitt <florian@ecole-et-nature.org>
29
//Autres auteurs :
29
//Autres auteurs :
30
*@copyright     Tela-Botanica 2000-2006
30
*@copyright     Tela-Botanica 2000-2006
31
*@version       $Revision: 1.99.2.10 $
31
*@version       $Revision: 1.99.2.11 $
32
// +------------------------------------------------------------------------------------------------------+
32
// +------------------------------------------------------------------------------------------------------+
33
*/
33
*/
Line 34... Line 34...
34
 
34
 
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
Line 114... Line 114...
114
*
114
*
115
* @return   string  HTML
115
* @return   string  HTML
116
*/
116
*/
117
function baz_voir_fiche($danslappli, $idfiche='') {
117
function baz_voir_fiche($danslappli, $idfiche='') {
118
	$res='';
118
	$res='';
119
	if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche']=$_GET['id_fiche'];
119
	if (isset($_GET['id_fiche'])) $GLOBALS['_BAZAR_']['id_fiche'] = $_GET['id_fiche'];
120
	if ($idfiche!='') $GLOBALS['_BAZAR_']['id_fiche']=$idfiche;	
120
	if ($idfiche != '') $GLOBALS['_BAZAR_']['id_fiche'] = $idfiche;	
121
	$url= $GLOBALS['_BAZAR_']['url'];
121
	$url = $GLOBALS['_BAZAR_']['url'];
122
	$url->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_FICHE);
122
	$url->addQueryString(BAZ_VARIABLE_ACTION, BAZ_VOIR_FICHE);
123
	$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
123
	$url->addQueryString('id_fiche', $GLOBALS['_BAZAR_']['id_fiche']);
124
	$url = preg_replace ('/&amp;/', '&', $url->getURL()) ;
124
	$url = preg_replace ('/&amp;/', '&', $url->getURL()) ;
Line 125... Line 125...
125
	
125
	
Line 484... Line 484...
484
						$res .= '&nbsp;&nbsp;<a href="'.$url_comment->getURL().'">'.BAZ_SUPPRIMER.'</a>'."\n";
484
						$res .= '&nbsp;&nbsp;<a href="'.$url_comment->getURL().'">'.BAZ_SUPPRIMER.'</a>'."\n";
485
					}
485
					}
486
					$res .= '</div>'."\n";
486
					$res .= '</div>'."\n";
487
					$res .= '</div>'."\n";			
487
					$res .= '</div>'."\n";			
488
				}
488
				}
-
 
489
			}else {
-
 
490
				$res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
489
			}
491
			}
490
			else $res .= BAZ_PAS_DE_COMMENTAIRES.'<br /><br />'."\n";
-
 
Line 491... Line 492...
491
			
492
			
-
 
493
			//formulaire des commentaires
492
			//formulaire des commentaires
494
			if ($GLOBALS['AUTH']->getAuth()) {
493
			$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
495
				$form_commentaire = new HTML_QuickForm('bazar_commentaire', 'post', $url);
494
			$squelette =& $form_commentaire->defaultRenderer();
496
				$squelette =& $form_commentaire->defaultRenderer();
495
			$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
497
				$squelette->setFormTemplate("\n".'<form {attributes}>'."\n".'{content}'."\n".'</form>'."\n");
496
			$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
498
				$squelette->setElementTemplate( '<label style="width:200px;">{label}'.
497
											'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
499
												'<!-- BEGIN required --><span class="symbole_obligatoire">&nbsp;*</span><!-- END required -->'."\n".
498
										    '</label><br />'."\n".'{element}<br />'."\n");
500
											    '</label><br />'."\n".'{element}<br />'."\n");
499
			$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
501
				$squelette->setRequiredNoteTemplate("\n".'<span class="symbole_obligatoire"> *{requiredNote}</span>'."\n");
500
			$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
502
				$option=array('style'=>'width:300px;border:1px solid #000;', 'maxlength'=>100);
501
			$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
503
				$form_commentaire->addElement('text', 'Nom', BAZ_ENTREZ_VOTRE_NOM, $option);
502
			$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;');
504
				$option=array('style'=>'width:95%;height:100px;white-space: pre;padding:3px;border:1px solid #000;');
503
			require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
505
				require_once PAP_CHEMIN_API_PEAR.'HTML/QuickForm/textarea.php';
504
			$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
506
				$formtexte= new HTML_QuickForm_textarea('Commentaire', BAZ_ENTREZ_VOTRE_COMMENTAIRE, $option);
505
			$form_commentaire->addElement($formtexte) ;
507
				$form_commentaire->addElement($formtexte) ;
506
			$option=array('style'=>'border:1px solid #000;');
508
				$option=array('style'=>'border:1px solid #000;');
507
			$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
509
				$form_commentaire->addElement('submit', 'Envoyer', BAZ_ENVOYER, $option);
508
			$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
510
				$form_commentaire->addRule('Nom', BAZ_NOM_REQUIS, 'required', '', 'client') ;
509
			$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
511
				$form_commentaire->addRule('Commentaire', BAZ_COMMENTAIRE_REQUIS, 'required', '', 'client') ;
510
			$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
512
				$form_commentaire->setRequiredNote(BAZ_CHAMPS_REQUIS) ;
-
 
513
				$res .= $form_commentaire->toHTML();
511
			$res .= $form_commentaire->toHTML();
514
			}
512
			$res .= '</div>'."\n";
515
			$res .= '</div>'."\n";
513
		}
516
		}
Line 514... Line 517...
514
	}
517
	}
515
	
518
	
516
	// Nettoyage de l'url
519
	// Nettoyage de l'url avant les return : apparement inutile sinon pose pb dans Papyrus (url applette deconnexion et moteur de recherche) [jpm le 17 mars 2008]
517
	$GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_ACTION);
520
	//$GLOBALS['_BAZAR_']['url']->removeQueryString(BAZ_VARIABLE_ACTION);
518
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
521
	//$GLOBALS['_BAZAR_']['url']->removeQueryString('id_fiche');
519
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_commentaire');
522
	$GLOBALS['_BAZAR_']['url']->removeQueryString('id_commentaire');
520
	$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
523
	$GLOBALS['_BAZAR_']['url']->removeQueryString('typeannonce');
Line 1251... Line 1254...
1251
}
1254
}
Line 1252... Line 1255...
1252
 
1255
 
1253
/* +--Fin du code ----------------------------------------------------------------------------------------+
1256
/* +--Fin du code ----------------------------------------------------------------------------------------+
1254
*
1257
*
-
 
1258
* $Log: not supported by cvs2svn $
-
 
1259
* Revision 1.99.2.10  2008-02-04 13:03:09  alexandre_tb
-
 
1260
* ajout d un class css dans les h2
1255
* $Log: not supported by cvs2svn $
1261
*
1256
* Revision 1.99.2.9  2008-02-01 16:24:10  florian
1262
* Revision 1.99.2.9  2008-02-01 16:24:10  florian
1257
* ajout champs_mail, décommenter les traductions des javascripts
1263
* ajout champs_mail, décommenter les traductions des javascripts
1258
*
1264
*
1259
* Revision 1.99.2.8  2008-01-29 09:35:37  alexandre_tb
1265
* Revision 1.99.2.8  2008-01-29 09:35:37  alexandre_tb