Documentation/Index/ContractPluginCustomScripts: ContractPluginBeforeSave.inc

Plik ContractPluginBeforeSave.inc, 879 bytes (dodany przez TS, 4 years temu)
xx
Line 
1<?php
2
3/**
4 * OfferDocumentPluginAfterCreate
5 *
6 * @author Tomasz Świenty
7 * @version 0.3
8 * @copyright Copyright (c) eDokumenty
9 */
10final class ContractPluginBeforeSave {
11
12
13    /**
14     * @param $args
15     * @return bool
16     * @throws RequestAbortException
17     */
18    public static function init($args) {
19
20        if (!isset($args['container']) OR !is_a($args['container'], 'ContractPlugin')) {
21            return FALSE;
22        }
23
24        // dane z pól
25        // $args['document']->data
26
27        $cHWND = Application::getShortName(__CLASS__.__LINE__);
28
29        if (ConfirmBox::sweetConfirm($cHWND, ['html' => 'Czy na pewno chcesz zapisać'], NULL, ConfirmBox::CONFIRM_YES|ConfirmBox::CONFIRM_CANCEL) == ConfirmBox::CONFIRM_YES) {
30            // to pozwól zapisać
31        }
32
33        return TRUE;
34
35    }
36
37}
38
39if (isset($args)) {
40    ContractPluginBeforeSave::init($args);
41}