From: Martin Helmling martin.helmling@octosoft.eu Date: Fri, 26 Jan 2018 11:43:06 +0000 (+0100) Subject: Projekte: Dateianhänge auch für Projekte X-Git-Tag: kivitendo-mebil_0.1-0~9^2~364 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ebe30b2d09629c061b8df6f3018adca7595a75d1;p=kivitendo-erp.git Projekte: Dateianhänge auch für Projekte Cherry-pick aus odyn (Upgrade Skript entsprechend geändert) implemntiert EGW #6889 --- diff --git a/SL/Controller/File.pm b/SL/Controller/File.pm index 95030a4a8..9005d79d6 100644 --- a/SL/Controller/File.pm +++ b/SL/Controller/File.pm @@ -66,6 +66,7 @@ my %file_types = ( 'purchase_invoice' => { gen => 6, gltype => 'ap', dir =>'PurchaseInvoice', model => 'PurchaseInvoice',right => 'import_ap' }, 'vendor' => { gen => 0, gltype => '', dir =>'Vendor', model => 'Vendor', right => 'xx' }, 'customer' => { gen => 1, gltype => '', dir =>'Customer', model => 'Customer', right => 'xx' }, + 'project' => { gen => 0, gltype => '', dir =>'Project', model => 'Project', right => 'xx' }, 'part' => { gen => 0, gltype => '', dir =>'Part', model => 'Part', right => 'xx' }, 'gl_transaction' => { gen => 6, gltype => 'gl', dir =>'GeneralLedger', model => 'GLTransaction', right => 'import_ap' }, 'draft' => { gen => 0, gltype => '', dir =>'Draft', model => 'Draft', right => 'xx' }, diff --git a/SL/Controller/Project.pm b/SL/Controller/Project.pm index 72f9bd4b2..ba460c597 100644 --- a/SL/Controller/Project.pm +++ b/SL/Controller/Project.pm @@ -244,6 +244,7 @@ sub display_form { CVar->render_inputs(variables => $params{CUSTOM_VARIABLES}) if @{ $params{CUSTOM_VARIABLES} }; + $::request->layout->use_javascript('kivi.File.js'); $self->setup_edit_action_bar(callback => $params{callback}); $self->render('project/form', %params); diff --git a/sql/Pg-upgrade2/file_storage_project.sql b/sql/Pg-upgrade2/file_storage_project.sql new file mode 100644 index 000000000..4ad74e4c4 --- /dev/null +++ b/sql/Pg-upgrade2/file_storage_project.sql @@ -0,0 +1,19 @@ +-- @tag: file_storage_project +-- @description: Dateispeicher auch für Projekte anbieten +-- @depends: file_storage_dunning_invoice + +ALTER TABLE files + DROP CONSTRAINT valid_type; +ALTER TABLE files + ADD CONSTRAINT valid_type CHECK ( + (object_type = 'credit_note' ) OR (object_type = 'invoice' ) OR (object_type = 'sales_order' ) + OR (object_type = 'sales_quotation' ) OR (object_type = 'sales_delivery_order' ) OR (object_type = 'request_quotation' ) + OR (object_type = 'purchase_order' ) OR (object_type = 'purchase_delivery_order' ) OR (object_type = 'purchase_invoice' ) + OR (object_type = 'vendor' ) OR (object_type = 'customer' ) OR (object_type = 'part' ) + OR (object_type = 'gl_transaction' ) OR (object_type = 'dunning' ) OR (object_type = 'dunning1' ) + OR (object_type = 'dunning2' ) OR (object_type = 'dunning3' ) OR (object_type = 'dunning_orig_invoice' ) + OR (object_type = 'dunning_invoice' ) OR (object_type = 'draft' ) OR (object_type = 'statement' ) + OR (object_type = 'shop_image' ) + OR (object_type = 'letter' ) + OR (object_type = 'project' ) + ); diff --git a/templates/webpages/project/form.html b/templates/webpages/project/form.html index 67df852e4..d5bb5b887 100644 --- a/templates/webpages/project/form.html +++ b/templates/webpages/project/form.html @@ -20,6 +20,12 @@ [%- IF SELF.may_edit_invoice_permissions %]
  • [% 'Permissions for invoices' | $T8 %]
  • [%- END %] + [%- IF SELF.project.id %] +
  • [% 'Project Details' | $T8 %]
  • + [%- IF INSTANCE_CONF.get_doc_storage %] +
  • [% 'Attachments' | $T8 %]
  • + [%- END %] + [%- END %] [%- IF SELF.project.id and AUTH.assert('record_links', 1) %]
  • [% 'Linked Records' | $T8 %]
  • [%- END %]