diff --git a/LICENSE.3RDPARTY b/LICENSE.3RDPARTY index a42ffa6a..ecc88b72 100644 --- a/LICENSE.3RDPARTY +++ b/LICENSE.3RDPARTY @@ -1,5 +1,5 @@ This file contains license details for 3rd party software which is -distributed with Jutda Helpdesk. +distributed with django-helpdesk. 1. License for jQuery & jQuery UI 2. License for jQuery UI 'Smoothness' theme diff --git a/helpdesk/forms.py b/helpdesk/forms.py index ecadc515..ca86dd5d 100644 --- a/helpdesk/forms.py +++ b/helpdesk/forms.py @@ -77,7 +77,7 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm): class Meta: model = Ticket exclude = ('created', 'modified', 'status', 'on_hold', 'resolution', 'last_escalation', 'assigned_to') - + def __init__(self, *args, **kwargs): """ Add any custom fields that are defined to the form @@ -101,7 +101,7 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm): def save(self, *args, **kwargs): - + for field, value in self.cleaned_data.items(): if field.startswith('custom_'): field_name = field.replace('custom_', '', 1) @@ -112,7 +112,7 @@ class EditTicketForm(CustomFieldMixin, forms.ModelForm): cfv = TicketCustomFieldValue(ticket=self.instance, field=customfield) cfv.value = value cfv.save() - + return super(EditTicketForm, self).save(*args, **kwargs) @@ -228,7 +228,7 @@ class TicketForm(CustomFieldMixin, forms.Form): except User.DoesNotExist: t.assigned_to = None t.save() - + for field, value in self.cleaned_data.items(): if field.startswith('custom_'): field_name = field.replace('custom_', '', 1) @@ -251,7 +251,7 @@ class TicketForm(CustomFieldMixin, forms.Form): } f.save() - + files = [] if self.cleaned_data['attachment']: import mimetypes @@ -265,9 +265,9 @@ class TicketForm(CustomFieldMixin, forms.Form): ) a.file.save(file.name, file, save=False) a.save() - + if file.size < getattr(settings, 'MAX_EMAIL_ATTACHMENT_SIZE', 512000): - # Only files smaller than 512kb (or as defined in + # Only files smaller than 512kb (or as defined in # settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email. try: files.append([a.filename, a.file]) @@ -276,7 +276,7 @@ class TicketForm(CustomFieldMixin, forms.Form): context = safe_template_context(t) context['comment'] = f.comment - + messages_sent_to = [] if t.submitter_email: @@ -443,9 +443,9 @@ class PublicTicketForm(CustomFieldMixin, forms.Form): ) a.file.save(file.name, file, save=False) a.save() - + if file.size < getattr(settings, 'MAX_EMAIL_ATTACHMENT_SIZE', 512000): - # Only files smaller than 512kb (or as defined in + # Only files smaller than 512kb (or as defined in # settings.MAX_EMAIL_ATTACHMENT_SIZE) are sent via email. files.append([a.filename, a.file]) @@ -523,12 +523,11 @@ class UserSettingsForm(forms.Form): required=False, ) - tickets_per_page = forms.IntegerField( + tickets_per_page = forms.ChoiceField( label=_('Number of tickets to show per page'), help_text=_('How many tickets do you want to see on the Ticket List page?'), required=False, - min_value=1, - max_value=1000, + choices=((10,'10'),(25,'25'),(50,'50'),(100,'100')), ) use_email_as_submitter = forms.BooleanField( @@ -543,17 +542,39 @@ class EmailIgnoreForm(forms.ModelForm): exclude = [] class TicketCCForm(forms.ModelForm): + ''' Adds either an email address or helpdesk user as a CC on a Ticket. Used for processing POST requests. ''' def __init__(self, *args, **kwargs): super(TicketCCForm, self).__init__(*args, **kwargs) if helpdesk_settings.HELPDESK_STAFF_ONLY_TICKET_CC: users = User.objects.filter(is_active=True, is_staff=True).order_by(User.USERNAME_FIELD) else: users = User.objects.filter(is_active=True).order_by(User.USERNAME_FIELD) - self.fields['user'].queryset = users + self.fields['user'].queryset = users class Meta: model = TicketCC exclude = ('ticket',) +class TicketCCUserForm(forms.ModelForm): + ''' Adds a helpdesk user as a CC on a Ticket ''' + def __init__(self, *args, **kwargs): + super(TicketCCUserForm, self).__init__(*args, **kwargs) + if helpdesk_settings.HELPDESK_STAFF_ONLY_TICKET_CC: + users = User.objects.filter(is_active=True, is_staff=True).order_by(User.USERNAME_FIELD) + else: + users = User.objects.filter(is_active=True).order_by(User.USERNAME_FIELD) + self.fields['user'].queryset = users + class Meta: + model = TicketCC + exclude = ('ticket','email',) + +class TicketCCEmailForm(forms.ModelForm): + ''' Adds an email address as a CC on a Ticket ''' + def __init__(self, *args, **kwargs): + super(TicketCCEmailForm, self).__init__(*args, **kwargs) + class Meta: + model = TicketCC + exclude = ('ticket','user',) + class TicketDependencyForm(forms.ModelForm): class Meta: model = TicketDependency diff --git a/helpdesk/static/helpdesk/helpdesk-extend.css b/helpdesk/static/helpdesk/helpdesk-extend.css index ddc23fcb..e2c0e59a 100644 --- a/helpdesk/static/helpdesk/helpdesk-extend.css +++ b/helpdesk/static/helpdesk/helpdesk-extend.css @@ -2,6 +2,26 @@ Bootstrap overrides */ +.btn-file { + position: relative; + overflow: hidden; +} +.btn-file input[type=file] { + position: absolute; + top: 0; + right: 0; + min-width: 100%; + min-height: 100%; + font-size: 100px; + text-align: right; + filter: alpha(opacity=0); + opacity: 0; + outline: none; + background: white; + cursor: inherit; + display: block; +} + .thumbnail.filterBox { display: none; float: left; @@ -52,4 +72,4 @@ Add your custom styles here padding: 10px 0; } #helpdesk-body {padding-top: 100px;} -img.brand {padding-right: 30px;} \ No newline at end of file +img.brand {padding-right: 30px;} diff --git a/helpdesk/templates/helpdesk/base.html b/helpdesk/templates/helpdesk/base.html index 45eba476..8c53fff8 100644 --- a/helpdesk/templates/helpdesk/base.html +++ b/helpdesk/templates/helpdesk/base.html @@ -27,10 +27,6 @@ - - - - {% if helpdesk_settings.HELPDESK_USE_CDN %} @@ -38,6 +34,16 @@ {% endif %} + + + + + + + + + + @@ -47,7 +53,7 @@ {% else %} {% endif %} - + {% if helpdesk_settings.HELPDESK_USE_CDN %} @@ -56,6 +62,14 @@ {% endif %} + + + + + + + + diff --git a/helpdesk/templates/helpdesk/include/unassigned.html b/helpdesk/templates/helpdesk/include/unassigned.html index ba4e3d57..266615d3 100644 --- a/helpdesk/templates/helpdesk/include/unassigned.html +++ b/helpdesk/templates/helpdesk/include/unassigned.html @@ -28,7 +28,7 @@
Are you sure you wish to delete the attachment {{ filename }} from this ticket? The attachment data will be permanently deleted from the database, but the attachment itself will still exist on the server.
+{% endblocktrans %} + + + + +{% endblock %} diff --git a/helpdesk/templates/helpdesk/ticket_cc_add.html b/helpdesk/templates/helpdesk/ticket_cc_add.html index 4e6f23bd..edd724f9 100644 --- a/helpdesk/templates/helpdesk/ticket_cc_add.html +++ b/helpdesk/templates/helpdesk/ticket_cc_add.html @@ -2,24 +2,62 @@ {% block helpdesk_title %}{% trans "Add Ticket CC" %}{% endblock %} -{% block helpdesk_body %}{% blocktrans %} -To automatically send an email to a user or e-mail address when this ticket is updated, select the user or enter an e-mail address below.
{% endblocktrans %} +Are you sure you wish to remove the dependency on this ticket?
{% endblocktrans %} - + - + {% endblock %} diff --git a/helpdesk/templates/helpdesk/ticket_desc_table.html b/helpdesk/templates/helpdesk/ticket_desc_table.html index 7717f961..aec8d39b 100644 --- a/helpdesk/templates/helpdesk/ticket_desc_table.html +++ b/helpdesk/templates/helpdesk/ticket_desc_table.html @@ -13,9 +13,9 @@{{ ticket.id }}. {{ ticket.title }} [{{ ticket.get_status }}] | |
{% blocktrans with ticket.queue as queue %}Queue: {{ queue }}{% endblocktrans %} |
---|