mirror of
https://github.com/jwinterm/modoboa.git
synced 2026-10-18 05:51:26 +02:00
Ticket #8
Mootools calendar plugin update. We are now using the rc4 version (http://www.electricprism.com/aeron/calendar/).
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
from django import forms
|
||||
from models import ARmessage
|
||||
from django.utils.translation import ugettext as _
|
||||
import datetime
|
||||
|
||||
class ARmessageForm(forms.ModelForm):
|
||||
class Meta:
|
||||
@@ -11,3 +12,8 @@ class ARmessageForm(forms.ModelForm):
|
||||
super(ARmessageForm, self).__init__(*args, **kwargs)
|
||||
self.fields['subject'].widget.attrs['size'] = 40
|
||||
self.fields['content'].widget.attrs['cols'] = 50
|
||||
|
||||
def clean_untildate(self):
|
||||
if self.cleaned_data["untildate"] < datetime.date.today():
|
||||
raise forms.ValidationError(_("This date is over"))
|
||||
return self.cleaned_data['untildate']
|
||||
|
||||
@@ -12,10 +12,14 @@ class Alias(models.Model):
|
||||
|
||||
class ARmessage(models.Model):
|
||||
mbox = models.ForeignKey(Mailbox)
|
||||
subject = models.CharField(_('subject'), max_length=255)
|
||||
content = models.TextField(_('content'))
|
||||
enabled = models.BooleanField(_('enabled'))
|
||||
untildate = models.DateTimeField(_('until'))
|
||||
subject = models.CharField(_('subject'), max_length=255,
|
||||
help_text=_("The subject that will appear in sended emails"))
|
||||
content = models.TextField(_('content'),
|
||||
help_text=_("The content that will appear in sended emails"))
|
||||
enabled = models.BooleanField(_('enabled'),
|
||||
help_text=_("Activate/Deactivate your auto reply"))
|
||||
untildate = models.DateField(_('until'),
|
||||
help_text=_("Activate your auto reply until this date"))
|
||||
|
||||
class ARhistoric(models.Model):
|
||||
armessage = models.ForeignKey(ARmessage)
|
||||
|
||||
@@ -2,9 +2,6 @@
|
||||
{% load i18n %}
|
||||
{% block html_head %}
|
||||
<script src="/static/js/form.js" type="text/javascript"></script>
|
||||
<!--<link rel="stylesheet" type="text/css"
|
||||
href="/static/stylesheets/datepicker/vista.css" />
|
||||
<script src="/static/js/datepicker.js" type="text/javascript"></script>-->
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="/static/stylesheets/calendar.css" />
|
||||
<script type="text/javascript" src="/static/js/calendar.js"></script>
|
||||
@@ -18,7 +15,7 @@
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
window.addEvent("domready", function() {
|
||||
cal = new Calendar({id_untildate: "d/m/Y"});
|
||||
var cal = new Calendar({id_untildate: "Y-m-d"}, {tweak: {x: -100, y:-100}});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
|
||||
@@ -149,7 +149,8 @@ def move(request):
|
||||
@is_not_localadmin()
|
||||
def delete(request, fdname, mail_id):
|
||||
mbc = IMAPconnector(user=request.user.username)
|
||||
mbc.move(mail_id, fdname, "Trash")
|
||||
mbc.move(mail_id, fdname, parameters.get_user(request.user, "webmail",
|
||||
"TRASH_FOLDER"))
|
||||
return folder(request, fdname, False)
|
||||
|
||||
@login_required
|
||||
|
||||
+1104
-1344
File diff suppressed because it is too large
Load Diff
+13
-4
@@ -1,11 +1,14 @@
|
||||
window.addEvent("domready", function() {
|
||||
sqbsubmit = function(obj, dest, id, callback) {
|
||||
sqbsubmit = function(obj, dest, id, callback, onerror) {
|
||||
obj.set('send', {
|
||||
onSuccess: function(responseText) {
|
||||
var decode = JSON.decode(responseText);
|
||||
if (decode.status == "ko") {
|
||||
$(dest).set("html", decode.content);
|
||||
$(id).addEvent("submit", callback);
|
||||
if ($defined(onerror)) {
|
||||
onerror();
|
||||
}
|
||||
} else {
|
||||
if (decode.url != "")
|
||||
parent.location.href = decode.url;
|
||||
@@ -16,9 +19,9 @@ window.addEvent("domready", function() {
|
||||
obj.send();
|
||||
}
|
||||
|
||||
generic_submit = function(obj, event, id, callback) {
|
||||
generic_submit = function(obj, event, id, callback, onerror) {
|
||||
event.stop();
|
||||
sqbsubmit(obj, "content", id, callback);
|
||||
sqbsubmit(obj, "content", id, callback, onerror);
|
||||
}
|
||||
domain_submit = function(event) {
|
||||
generic_submit(this, event, "domform", domain_submit);
|
||||
@@ -35,8 +38,14 @@ window.addEvent("domready", function() {
|
||||
chpassword_submit = function(event) {
|
||||
generic_submit(this, event, "chpwdform", chpassword_submit);
|
||||
}
|
||||
|
||||
arm_onerror = function() {
|
||||
new Calendar({id_untildate: "Y-m-d"}, {
|
||||
tweak: {x: -100, y:-100}
|
||||
});
|
||||
}
|
||||
arm_submit = function(event) {
|
||||
generic_submit(this, event, "armform", arm_submit);
|
||||
generic_submit(this, event, "armform", arm_submit, arm_onerror);
|
||||
}
|
||||
|
||||
if ($("domform"))
|
||||
|
||||
@@ -11,8 +11,4 @@ window.addEvent('domready', function() {
|
||||
}
|
||||
}, $('accordion'));
|
||||
|
||||
new DatePicker("#untildate", {
|
||||
pickerClass: "datepicker_vista",
|
||||
allowEmpty: true
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user