| 1 | = API komend workflow = |
| 2 | |
| 3 | |
| 4 | {{{ |
| 5 | <?php |
| 6 | require_once(COMMANDS_DIR.'AbsCommand.inc'); |
| 7 | require_once(LIB_PATH.'util/Strings.inc'); |
| 8 | |
| 9 | /** |
| 10 | * |
| 11 | * |
| 12 | * @uses AbsCommand |
| 13 | * @uses ICommand |
| 14 | * @final |
| 15 | */ |
| 16 | final class DeletePropertiesCommand extends AbsCommand implements ICommand { |
| 17 | |
| 18 | |
| 19 | |
| 20 | /** |
| 21 | * getDescription |
| 22 | * |
| 23 | * @static |
| 24 | * @access public |
| 25 | * @return void |
| 26 | */ |
| 27 | public static function getDescription() { |
| 28 | |
| 29 | return Translator::translate('Usuń przypisania parametrów procedury'); |
| 30 | |
| 31 | } |
| 32 | |
| 33 | |
| 34 | |
| 35 | /** |
| 36 | * getExpandedDescription |
| 37 | * |
| 38 | * @param string $params |
| 39 | * @static |
| 40 | * @access public |
| 41 | * @return void |
| 42 | */ |
| 43 | public static function getExpandedDescription($params = NULL) { |
| 44 | |
| 45 | return Translator::translate('Komenda służy do usunięcia parametrów procedury'); |
| 46 | |
| 47 | } |
| 48 | |
| 49 | |
| 50 | |
| 51 | /** |
| 52 | * getCommandApi |
| 53 | * |
| 54 | * @param string $params |
| 55 | * @static |
| 56 | * @access public |
| 57 | * @return void |
| 58 | */ |
| 59 | public static function getCommandApi($params = NULL) { |
| 60 | |
| 61 | $api = array( |
| 62 | ); |
| 63 | |
| 64 | return $api; |
| 65 | |
| 66 | } |
| 67 | |
| 68 | |
| 69 | |
| 70 | /** |
| 71 | * execute |
| 72 | * |
| 73 | * @param Bean $bean |
| 74 | * @param string $params |
| 75 | * @access public |
| 76 | * @return void |
| 77 | */ |
| 78 | public function execute(Bean $bean, $params) { |
| 79 | |
| 80 | if (!($bean instanceof Document)) { |
| 81 | $this->setMessage(Translator::translate('Komenda może być wykonana jedynie dla dokumentu.'), 'WARNING'); |
| 82 | $this->setMessage(Translator::translate('Komenda nie została wykonana.'), 'ERROR'); |
| 83 | throw new CommandException($this); |
| 84 | } |
| 85 | |
| 86 | $data['doc_id'] = $bean->get('doc_id'); |
| 87 | $test = $this->db->delete('bpm_property_values', 'id____ = 1 AND procid=( |
| 88 | SELECT procid FROM documents WHERE doc_id = '.$data['doc_id'].' LIMIT 1)'); |
| 89 | |
| 90 | $this->setMessage(Translator::translate('Komenda została wykonana poprawnie.'.$test), 'SUCCESS'); |
| 91 | |
| 92 | return TRUE; |
| 93 | |
| 94 | } |
| 95 | |
| 96 | } // class RegisterDocumentCommand |
| 97 | |
| 98 | ?> |
| 99 | |
| 100 | }}} |