ScoDoc/dtml/entreprises/entreprise_contact_edit.dtml

62 lines
2.9 KiB
Plaintext

<dtml-call "REQUEST.set( 'F', do_entreprise_contact_list( args={ 'entreprise_contact_id' : entreprise_contact_id } )[0])">
<dtml-call "REQUEST.set( 'entreprise_id', F['entreprise_id'])">
<dtml-call "REQUEST.set( 'link_create_corr', make_link_create_corr(F['entreprise_id']) )">
<dtml-call "REQUEST.set( 'E', do_entreprise_list( args={ 'entreprise_id' : F['entreprise_id'] } )[0])">
<dtml-call "REQUEST.set( 'correspondants',
do_entreprise_correspondant_listnames( args={ 'entreprise_id' : F['entreprise_id'] })+ [ ('inconnu','') ])">
<dtml-var "entreprise_header(REQUEST=REQUEST)">
<h2 class="entreprise_contact"><dtml-var title_or_id></h2>
<h3>Contact avec entreprise <dtml-var "E['nom']"></h3>
<dtml-call "REQUEST.set('tf', TrivialFormulator( URL0, REQUEST.form,
( ('entreprise_contact_id', { 'default' : entreprise_contact_id, 'input_type' : 'hidden' }),
('entreprise_id', { 'input_type' : 'hidden', 'default' : F['entreprise_id'] }),
('type_contact', { 'input_type' : 'menu', 'title' : 'Objet',
'allowed_values' : ('Prospection', 'Stage étudiant', 'Contrat Apprentissage', 'Projet', 'Autre' ),
}),
('date', { 'size' : 12, 'title' : 'Date du contact (j/m/a)', 'allow_null' : False }),
('entreprise_corresp_id', { 'input_type' : 'menu', 'title' : 'Correspondant entreprise',
'explanation' : link_create_corr,
'allow_null' : True,
'labels' : [ x[0] for x in correspondants ],
'allowed_values' : [ x[1] for x in correspondants ] }),
('etudiant', { 'size' : 16, 'title' : 'Etudiant concerné', 'allow_null' : True,
'default' : F['etudid'],
'explanation' : 'nom (si pas ambigu) ou code' }),
('enseignant', { 'size' : 16, 'title' : 'Enseignant (tuteur)', 'allow_null' : True }),
('description', { 'input_type' : 'textarea', 'rows' : 3, 'cols': 40, 'title' : 'Description' }),
),
cancelbutton = 'Annuler',
initvalues = F,
submitlabel = 'Modifier les valeurs', readonly = REQUEST['_read_only']
))">
<dtml-call "REQUEST.set( 'etudok', do_entreprise_check_etudiant(etudiant) )">
<dtml-if "(tf[0] == 0) or (etudok[0] == 0)">
<dtml-if "etudok[0] == 0">
<p class="entreprise_warning"><dtml-var "etudok[1]"></p>
</dtml-if>
<dtml-var "tf[1]">
<dtml-unless "REQUEST['_read_only']">
<p class="entreprise_descr"><a class="entreprise_delete" href="entreprise_contact_delete?entreprise_contact_id=<dtml-var entreprise_contact_id>">Supprimer ce contact</a> </p>
</dtml-unless>
<dtml-elif "tf[0] == -1">
<dtml-call "RESPONSE.redirect( URL1 )" >
<dtml-else>
<dtml-call "tf[2].update( { 'etudid' : etudok[1] })">
<dtml-call "do_entreprise_contact_edit( tf[2] )">
<dtml-call "RESPONSE.redirect( URL1 + '/entreprise_contact_list?entreprise_id=' + str(F['entreprise_id']) )" >
</dtml-if>
<dtml-var "entreprise_footer(REQUEST=REQUEST)">