getRequest()->getParameter('organizations', null, 'soteshop/stInPostApi'); if (null === $organizations) { try { $organizations = $api->getOrganizations(); } catch(stInPostApiException $e) { } } if ($organizations) { foreach ($organizations->items as $organization) { $options[$organization->id] = $organization->name; } } else { $options = array(); } return select_tag($name, options_for_select($options, $value), $params); } function st_inpost_sending_method_select_tag($name, $value, array $params = array()) { $api = stInPostApi::getInstance(); $service = null; if (isset($params['service'])) { $service = $params['service']; unset($params['service']); } $target = null; if (isset($params['target'])) { $target = $params['target']; } $includeCustom = __('Wybierz'); if (isset($params['include_custom'])) { $includeCustom = $params['include_custom']; } $options = array(); try { $options = $api->getSendingMethods($service); } catch (stInPostApiException $e) { } $content = select_tag($name, options_for_select($options, $value, array('include_custom' => $includeCustom)), $params); if ($target) { $id = get_id_from_name($name); $content .=<< jQuery(function($) { \$('#$id').change(function() { var select = \$(this); if (select.val() == 'parcel_locker') { $('$target').show(); } else { $('$target').hide(); } }).change(); }); HTML; } return $content; } function st_inpost_point_select_tag($name, $value, array $params = array()) { static $init = false; $config = stConfig::getInstance('stPaczkomatyBackend'); $api = stInPostApi::getInstance(); $i18n = sfContext::getInstance()->getI18N(); $label = $i18n->__('Wybierz punkt'); $id = get_id_from_name($name); $title = isset($params['title']) ? __($params['title']) : __('Wybierz punkt'); $disabled = isset($params['disabled']) && $params['disabled']; $js = ''; $trigger = ''; if (!$disabled) { if (!$init) { $easypackWidgetUrl = st_url_for('@stPaczkomatyPlugin?action=easypackWidget&sandbox=' . $api->isSandbox()); $js =<<

' . $point->address->line1 . ', ' . $point->address->line2 . '
'; } catch(stInPostApiException $e) { } } return input_hidden_tag($name, $value) . '