Project

General

Profile

« Previous | Next » 

Revision c6f5c60f

Added by Jérôme Schneider almost 12 years ago

dossiers: add option to create an address from a new contact

Closes #2738

View differences:

calebasse/dossiers/templates/dossiers/patientcontact_new.html
<tr {% if object.id == request.session.patientrecord_id %}style="display: none;"{%endif%}>
<td>
{{ form.addresses.label_tag }} :
<p id="contact-add-address">
<a href="#tab=2&newcontact" id="contact-add-address" role="button" title="Ajouter une adresse" onClick="javascript: load_add_address_dialog();">
<span class="icon-plus" title="Ajouter une adresse"></Span>
Ajouter une adresse
</a>
</p>
{{ form.addresses }}
{{ form.addresses.errors }}
</td>
......
{{ form.contact_comment.errors }}
</p>
</form>
<div id="address-dlg"></div>
calebasse/static/css/style.css
margin: 0;
}
#contact-add-address {
margin-top: 5px;
margin-left: 10px;
}
div#tabs-3 div.right {
text-align: right;
border: 0;
......
.icon-lock:before { content: "\f023"; }
.icon-remove-sign:before { content: "\f057"; }
.icon-remove:before { content: "\f00d"; }
.icon-plus:before { content: "\f067"; }
.icon-plus:before { content: "\f067"; }
.icon-minus:before { content: "\f068"; }
.icon-envelope:before { content: "\f003"; }
.icon-comment:before { content: "\f075"; }
calebasse/static/js/calebasse.dossiers.js
$('input#id_prolongation_date', that).datepicker({dateFormat: 'd/m/yy', showOn: 'button' });
}
function load_add_address_dialog() {
generic_ajaxform_dialog('address/new', 'Ajouter une adresse',
'#address-dlg', '600px', 'Ajouter');
}
function state_dialog(url, state_title, state_type) {
$('#change-record').load(url,
function () {
......
$(function() {
var $tabs = $('#tabs').tabs();
$('.atabs').click(function() {
location.hash = 'tab=' + $(this).data('id');
});
......
$tabs.tabs('select', parseInt(tabid));
}
});
})(window.jQuery)
$( document ).ready(function(){
var hashes = location.hash.split('&');
for (i in hashes) {
console.log(hashes[i]);
if (hashes[i] == "newcontact") {
$('#new-contact-btn').first().click();
}
}
location.hash = hashes[0];
});

Also available in: Unified diff