Documentation/Index/VatNoteCostFormAfterOpen: VatNoteCostFormAfterOpen.inc

Plik VatNoteCostFormAfterOpen.inc, 840 bytes (dodany przez TS, 8 years temu)
xx
Line 
1<?php
2
3/**
4 * VatNoteCostFormAfterOpen
5 *
6 * @author Tomasz Świenty
7 * @version 0.1
8 * @copyright Copyright (c) eDokumenty
9 */
10final class VatNoteCostFormAfterOpen {
11
12
13
14    public static function init($args) {
15
16        if (!isset($args['container'])) {
17            return FALSE;
18        }
19
20        if (!is_object($args['container']) OR !is_a($args['container'], 'Dialog')) {
21            return FALSE;
22        }
23
24        $data = $args['container']->getData();
25        if (!isset($data['doc_id'])) {
26            return FALSE;
27        }
28
29        // domyślne wartości ustawia tylko dla nowych czyli nie mających vtcoid
30        if (isset($data['vtcoid'])) {
31            return FALSE;
32        }
33
34        $args['container']->remark->setValue('Domyślny opis...');
35
36    }
37
38}
39
40if (isset($args)) {
41    VatNoteCostFormAfterOpen::init($args);
42}
43
44?>