1 | #!/usr/bin/php -f |
||
2 | <?php |
||
3 | /** |
||
4 | * FlexiPeeHP - Example how to upload Attachment |
||
5 | * |
||
6 | * @author Vítězslav Dvořák <[email protected]> |
||
7 | * @copyright (G) 2017 Vitex Software |
||
8 | */ |
||
9 | |||
10 | namespace Example\FlexiPeeHP; |
||
11 | |||
12 | include_once './config.php'; |
||
13 | include_once '../vendor/autoload.php'; |
||
14 | include_once './common.php'; |
||
15 | |||
16 | $invoiceID = askForFlexiBeeID(); |
||
17 | |||
18 | $invoice = new \FlexiPeeHP\FakturaVydana($invoiceID); |
||
19 | |||
20 | $result = \FlexiPeeHP\Priloha::addAttachmentFromFile($invoice, |
||
21 | '../flexipeehp.png'); |
||
22 | if ($result == 201) { |
||
23 | $allAttachments = \FlexiPeeHP\Priloha::getAttachmentsList($invoice); |
||
24 | $lastAttachment = end($allAttachments); |
||
25 | $invoice->addStatusMessage('Attachment '.$invoice->getFlexiBeeURL().'/prilohy/'.$lastAttachment['id'].'/content OK', |
||
26 | 'success'); |
||
27 | } else { |
||
28 | $invoice->addStatusMessage('Attachment '.$invoice->getFlexiBeeURL().' Failed', |
||
0 ignored issues
–
show
|
|||
29 | 'error'); |
||
30 | } |
||
31 | |||
32 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.