BoxBilling extension for file uploading to DropBox
##Installing extension
- Download this repository by using
git cloneorDownload ZIPbutton. - Create folder
Dropboxinbb-modulesdirectory. - Move all the files you downloaded to this folder.
- Go to
Extensions->Overviewin BoxBilling admin area findDropboxextension and clickActivate. You will be redirected to settings view. - Follow the istructions in next screen and generate Dropbox access code.
- Paste it into field in extension settings page and click Update. Extension is ready to use!
##Using extension This example will show you how to add ticket attachment functionality but feel free to use it in another context;
-
Please copy template you want to edit e.g.
bb-modules/Support/html_client/mod_support_ticket.phtmlto your theme html folder e.g.bb-themes/huraga/html(otherwise during next update it will be overwritten). -
Add following lines of code to client template you copied where you want upload form and download button to appear. If file is not uploaded, upload form will be shown, otherwise download button will be visible
{% if client.dropbox_has_upload({'rel_id':ticket.id, 'extension' : 'ticket'}) %}
{% include 'mod_dropbox_download.phtml' with {'rel_id':ticket.id, 'extension' : 'ticket'} %}
{% else %}
{% include 'mod_dropbox_upload.phtml' with {'rel_id':ticket.id, 'extension' : 'ticket'} %}
{% endif %}
- Make sure object (in this case ticket object) is present in template and pass object ID as 'rel_id' and change
extensionparameter if you want to use extension for other purposes! - Repeat these steps for admin template e.g.
mod_support_ticket.phtmlin order to see download button in admin area.
{% if admin.dropbox_has_upload({'rel_id':ticket.id, 'extension' : 'ticket'}) %}
{% include 'mod_dropbox_download.phtml' with {'rel_id':ticket.id, 'extension' : 'ticket'} %}
{% endif %}