public static function destroy($id)
 {
     self::check_logged_in();
     $itemtype = new ItemType(array('id' => $id));
     $itemtype->destroy();
     Redirect::to('/itemtype', array('message' => 'The item type has been removed successfully!'));
 }
 /**
  * sample_RelistItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $req = new RelistItemRequestType();
     $item = new ItemType();
     $item->setItemID($params['ItemID']);
     $req->setItem($item);
     $res = $this->proxy->RelistItem($req);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
 /**
  * sample_AddLiveAuctionItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $req = new AddLiveAuctionItemRequestType();
     $item = new ItemType();
     $item->setStartPrice($params['StartPrice']);
     $la = new LiveAuctionDetailsType();
     $la->setLotNumber($params['LotNumber']);
     $item->setLiveAuctionDetails($la);
     $req->setItem($item);
     $res = $this->proxy->AddLiveAuctionItem($req);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 4
0
 private static function _addPlayerElement()
 {
     if (element_exists(ElementSet::ITEM_TYPE_NAME, 'Player')) {
         return;
     }
     $db = get_db();
     $table = $db->getTable('ItemType');
     $mpType = $table->findByName('Moving Image');
     if (!is_object($mpType)) {
         $mpType = new ItemType();
         $mpType->name = "Moving Image";
         $mpType->description = "A series of visual representations imparting an impression of motion when shown in succession. Examples include animations, movies, television programs, videos, zoetropes, or visual output from a simulation.";
         $mpType->save();
     }
     $mpType->addElements(array(array('name' => 'Player', 'description' => 'html for embedded player to stream video content')));
     $mpType->save();
 }
Exemplo n.º 5
0
 public function ryi($params)
 {
     $this->session->setRequestToken($params['AuthToken']);
     $scope = $params['scope'];
     $req = new ReviseItemRequestType();
     $item = new ItemType();
     $item->setItemID($params['ItemID']);
     if (in_array('description', $scope)) {
         $item->setDescription($params['Description']);
     }
     if (in_array('sku', $scope)) {
         $item->setApplicationData($params['ApplicationData']);
         $item->setSKU($params['SKU']);
     }
     $item->setHitCounter("HiddenStyle");
     $req->setItem($item);
     $res = $this->proxy->ReviseItem($req);
     switch ($res->getAck()) {
         case AckCodeType::CodeType_Success:
             return true;
             break;
         case AckCodeType::CodeType_Warning:
             echo "Item ID: {$params['ItemID']}<br>";
             echo $this->proxy->getErrorsToString($res, true);
             return true;
             break;
         default:
             echo "Item ID: {$params['ItemID']}<br>";
             echo $this->proxy->getErrorsToString($res, true);
             $this->dumpObject($res);
             return false;
             break;
     }
 }
Exemplo n.º 6
0
 public static function update($id)
 {
     self::check_logged_in();
     $params = $_POST;
     $attributes = array('id' => $id, 'itemtype_id' => Item::find($id)->itemtype_id, 'description' => $params['description']);
     $item = new Item($attributes);
     $errors = $item->errors();
     if (count($errors) > 0) {
         $item = Item::find($id);
         $itemtype = ItemType::find($item->itemtype_id);
         View::make('item/edit.html', array('errors' => $errors, 'given_description' => $params['description'], 'item' => $item, 'itemtype' => $itemtype));
     } else {
         $item->update();
         Redirect::to('/item/' . $item->id, array('message' => 'The item has been modified successfully!'));
     }
 }
Exemplo n.º 7
0
 public function __construct($itemId, $typeId, $typeName, $name, $ref, $unit, $desc, $features, $manufacturer, $rprice, $wprice, $tax, $img, $plength, $pwidth, $pheight, $pweight, $pshape)
 {
     parent::__construct($typeId, $typeName, $unit);
     $this->itemId = $itemId;
     $this->name = $name;
     $this->reference = $ref;
     $this->description = $desc;
     $this->retail_price = $rprice;
     $this->wholesale_price = $wprice;
     $this->taxcode = $tax;
     $this->image = $img;
     $this->manufacturer = $manufacturer;
     $this->setFeatures($features);
     $this->setImages();
     $this->setShippingDetails($plength, $pwidth, $pheight, $pweight, $pshape);
 }
Exemplo n.º 8
0
}
if ($edited_Itemtype->is_special()) {
    // Don't edit a name of special post types
    $Form->info(T_('Name'), $edited_Itemtype->name);
} else {
    // Display a field to edit a name
    $Form->text_input('ityp_name', $edited_Itemtype->name, 50, T_('Name'), '', array('maxlength' => 30, 'required' => true));
}
$Form->textarea_input('ityp_description', $edited_Itemtype->description, 2, T_('Description'), array('cols' => 47));
$Form->radio('ityp_perm_level', $edited_Itemtype->perm_level, array(array('standard', T_('Standard')), array('restricted', T_('Restricted')), array('admin', T_('Admin'))), T_('Permission level'));
$Form->text_input('ityp_backoffice_tab', $edited_Itemtype->backoffice_tab, 25, T_('Back-office tab'), T_('Items of this type will be listed in this back-office tab. If empty, items will be found only in the "All" tab.'), array('maxlength' => 30));
$Form->text_input('ityp_template_name', $edited_Itemtype->template_name, 25, T_('Template name'), T_('b2evolution will automatically append .main.php or .disp.php'), array('maxlength' => 40));
$Form->end_fieldset();
$options = array(array('required', T_('Required')), array('optional', T_('Optional')), array('never', T_('Never')));
// Check if current type is intro and set specific params for the fields "ityp_allow_breaks" and "ityp_allow_featured":
$intro_type_disabled = ItemType::is_intro($edited_Itemtype->ID);
$intro_type_note = $intro_type_disabled ? T_('This feature is not compatible with Intro posts.') : '';
$Form->begin_fieldset(T_('Features') . get_manual_link('item-type-features'), array('id' => 'itemtype_features'));
$Form->radio('ityp_use_title', $edited_Itemtype->use_title, $options, T_('Use title'));
$Form->radio('ityp_use_text', $edited_Itemtype->use_text, $options, T_('Use text'));
$Form->checkbox('ityp_allow_html', $edited_Itemtype->allow_html, T_('Allow HTML'), T_('Check to allow HTML in posts.') . ' (' . T_('HTML code will pass several sanitization filters.') . ')');
$Form->checkbox('ityp_allow_breaks', $edited_Itemtype->allow_breaks, T_('Allow Teaser and Page breaks'), $intro_type_note, '', 1, $intro_type_disabled);
$Form->checkbox('ityp_allow_attachments', $edited_Itemtype->allow_attachments, T_('Allow attachments'));
$Form->checkbox('ityp_allow_featured', $edited_Itemtype->allow_featured, T_('Allow featured'), $intro_type_note, '', 1, $intro_type_disabled);
$Form->end_fieldset();
$Form->begin_fieldset(T_('Use of Advanced Properties') . get_manual_link('item-type-advanced-properties'), array('id' => 'itemtype_advprops'));
$Form->radio('ityp_use_tags', $edited_Itemtype->use_tags, $options, T_('Use tags'));
$Form->radio('ityp_use_excerpt', $edited_Itemtype->use_excerpt, $options, T_('Use excerpt'));
$Form->radio('ityp_use_url', $edited_Itemtype->use_url, $options, T_('Use URL'));
$Form->radio('ityp_use_parent', $edited_Itemtype->use_parent, $options, T_('Use Parent ID'));
$Form->radio('ityp_use_title_tag', $edited_Itemtype->use_title_tag, $options, htmlspecialchars(T_('Use <title> tag')));
Exemplo n.º 9
0
?>
",
                        dataType: 'html',
                        success: function(results)
                        {
                            $("#item_prop_values").empty();
                            $(results).appendTo("#item_prop_values");
                        }
                    });
        }
    });
</script>

<?php 
$cri = new CDbCriteria(array('condition' => 'enabled = 1'));
$ItemType = ItemType::model()->findAll($cri);
$list = CHtml::listData($ItemType, 'type_id', 'name');
echo $form->DropDownListRow($model, 'type_id', $list, array('empty' => '请选择商品类型', 'hint' => '请选择商品的所属类型,进而完善此商品的属性'));
//$props_list = Item::model()->findByPk($model->item_id);
//$props_arr = explode(';', $props_list->props);
//foreach ($props_arr as $k => $v) {
//    $newarr[] = explode(':', $v);
//}
//foreach ($newarr as $k => $v) {
//        $v_arr = explode(',', $v[1]);
//        $arr[$v[0]] = $v_arr;
//}
//print_r($arr);
?>

Exemplo n.º 10
0
 /**
  * Install default profile
  *
  * Install default item types, elements, and profiles for easy setup
  *
  * @param array An array of parameters with names and descriptions
  *  of the default values we are setting up
  * @return void
  */
 public function installDefaults($params)
 {
     if (!($itemType = get_db()->getTable('ItemType')->findByName($params['typeName']))) {
         $itemType = new ItemType();
         $itemType->name = $params['typeName'];
         $itemType->description = $params['typeDesc'];
         $id = $itemType->save();
     }
     require_once dirname(dirname(dirname(__FILE__))) . '/models/MmdProfile.php';
     $profile = new MmdProfile();
     $profile->setViewer($this);
     $profile->name = $params['profileName'];
     $profile->viewer = $this->name;
     foreach ($this->_paramInfo as $param) {
         //$element = new Element();
         //check if element exists in Dublin Core
         $element = get_db()->getTable('Element')->findByElementSetNameAndElementName('Dublin Core', $param['name']);
         if (empty($element)) {
             $element = get_db()->getTable('Element')->findByElementSetNameAndElementName('Dublin Core', ucfirst($param['name']));
         }
         if (empty($element)) {
             $element = get_db()->getTable('Element')->findByElementSetNameAndElementName('Dublin Core', strtoupper($param['name']));
         }
         if (empty($element)) {
             $element = get_db()->getTable('Element')->findByElementSetNameAndElementName('Item Type Metadata', $param['name']);
         }
         if (empty($element)) {
             $element = get_db()->getTable('Element')->findByElementSetNameAndElementName('Item Type Metadata', ucfirst($param['name']));
         }
         if (empty($element)) {
             $element = get_db()->getTable('Element')->findByElementSetNameAndElementName('Item Type Metadata', strtoupper($param['name']));
         }
         if (empty($element)) {
             $element = new Element();
             $element->setElementSet('Item Type Metadata');
             $element->setName($param['name']);
             $element->setDescription($param['description']);
             try {
                 $element->save();
             } catch (Exception $e) {
                 print_r($e);
                 die;
             }
         }
         $itemType->addElementById($element->id);
         if (isset($param['default']) && $param['default'] !== '') {
             $profile->setAuxParam($param['name'], $param['default'], 1);
         }
         if (isset($param['files'])) {
             $multiple = isset($param['multiple']) && $param['multiple'] != 'single' && $param['multiple'] ? 1 : 0;
             $fileparam = array('multiple' => isset($param['multiple']) && $param['multiple'] != 'single' && $param['multiple'] ? 1 : 0, 'extensions' => $param['files']);
             $profile->setAuxParam($param['name'], $fileparam, 2);
         }
         $profile->setAuxParam($param['name'], $element->id, 0);
     }
     $itemType->save();
     $item_type_id = $itemType->id;
     $profile->save();
     $profile_id = $profile->id;
     require_once dirname(dirname(dirname(__FILE__))) . '/models/MmdAssign.php';
     $assign = new MmdAssign();
     $assign->item_type_id = $item_type_id;
     $assign->profile_id = $profile_id;
     $assign->filetypes = $this->_allowedFiletypes;
     $assign->save();
     return 'Defaults installed successfully';
 }
Exemplo n.º 11
0
					  AND itc_coll_ID = ' . $DB->quote($blog));
                $Messages->add(T_('Post type has been disabled for this collection.'), 'success');
            }
        }
        // Redirect so that a reload doesn't write to the DB twice:
        header_redirect($admin_url . '?ctrl=itemtypes&blog=' . $blog . '&tab=' . $tab . '&tab3=' . $tab3 . '', 303);
        // Will EXIT
        // We have EXITed already at this point!!
        break;
    case 'default':
        // Set default item type for the selected collection:
        // Check that this action request is not a CSRF hacked request:
        $Session->assert_received_crumb('itemtype');
        // Check permission:
        $current_User->check_perm('blog_properties', 'edit', true, $blog);
        if ($edited_Itemtype && !ItemType::is_reserved($edited_Itemtype->ID)) {
            // Do only when item type exists in DB:
            // Update default item type to new selected:
            $Blog->set_setting('default_post_type', $edited_Itemtype->ID);
            $Blog->dbupdate();
            // Enable new default item type for the selected collection automatically:
            $DB->query('REPLACE INTO T_items__type_coll
								 ( itc_ityp_ID, itc_coll_ID )
					VALUES ( ' . $DB->quote($edited_Itemtype->ID) . ', ' . $DB->quote($blog) . ' )');
            $Messages->add(T_('The item type has been set as the default for this collection.'), 'success');
        }
        // Redirect so that a reload doesn't write to the DB twice:
        header_redirect($admin_url . '?ctrl=itemtypes&blog=' . $blog . '&tab=' . $tab . '&tab3=' . $tab3 . '', 303);
        // Will EXIT
        // We have EXITed already at this point!!
        break;
Exemplo n.º 12
0
 if ($addItem) {
     require_once $ebatns_dir . 'EbatNs_ServiceProxy.php';
     require_once $ebatns_dir . 'EbatNs_Logger.php';
     require_once $ebatns_dir . 'VerifyAddItemRequestType.php';
     require_once $ebatns_dir . 'AddItemRequestType.php';
     require_once $ebatns_dir . 'ItemType.php';
     require_once $ebatns_dir . 'ListingEnhancementsCodeType.php';
     require_once $ebatns_dir . 'BuyerPaymentMethodCodeType.php';
     require_once $ebatns_dir . 'CountryCodeType.php';
     $session = create_ebay_session();
     if ($session) {
         $ListingEnhancementsCodeType = new BuyerPaymentMethodCodeType();
         $PaymentMethodCode = new BuyerPaymentMethodCodeType();
         $CountryCodeType = new CountryCodeType();
         $cs = new EbatNs_ServiceProxy($session);
         $item = new ItemType();
         //auction type
         $item->setListingType($auction_type_name);
         $item->Currency = DEFAULT_CURRENCY;
         //currency
         $item->Site = 'Germany';
         //site (ebay.de)
         //use sheduling if there is one
         if (isset($future_auction)) {
             $item->setScheduleTime($mynewstarttime);
         }
         //set title
         $product_title = stripcslashes($product_title);
         $product_title = striptags($product_title);
         $item->Title = $product_title;
         //set subtitle
Exemplo n.º 13
0
<?php

$this->breadcrumbs = array(Yii::t('weekdays', 'Weekdays') => array('index'), Yii::t('weekdays', 'Manage'));
$this->beginWidget('zii.widgets.jui.CJuiDialog', array('id' => 'jobDialog', 'options' => array('title' => Yii::t('weekdays', 'Create Job'), 'autoOpen' => true, 'modal' => 'true', 'width' => 'auto', 'height' => 'auto')));
?>
                
<?php 
echo $form->dropDownList($model, 'item_type_id', CHtml::listData(ItemType::model()->findAll(), 'id', 'type'), array('empty' => 'select Type'));
?>
				
<?php 
$this->endWidget('zii.widgets.jui.CJuiDialog');
Exemplo n.º 14
0
        break;
        // end default
    // end default
    case 'save':
        $ERRORS = array();
        $class_id = stripinput($_POST['item']['class_id']);
        if ($class_id == null) {
            $ERRORS[] = 'No class specified.';
        } else {
            $class = new ItemClass($db);
            $class = $class->findOneByItemClassId($class_id);
            if ($class == null) {
                $ERRORS[] = 'Invalid class specified.';
            }
        }
        // end id given
        if (sizeof($ERRORS) > 0) {
            draw_errors($ERRORS);
        } else {
            $item = new ItemType($db);
            $item->setItemClassId($class->getItemClassId());
            $item->setUniqueItem('N');
            $item->setTransferableItem('Y');
            $item->save();
            redirect(null, null, "admin-items-edit/?item[id]={$item->getItemTypeId()}");
        }
        // end no errors
        break;
        // end save
}
// end state switch
Exemplo n.º 15
0
 /**
  * Check if this post type is special( reserved in system )
  *
  * @param integer Use this param ID of post type when object is not created
  * @return boolean
  */
 function is_special($ID = NULL)
 {
     $special_range = ItemType::get_special_range();
     if ($ID === NULL) {
         // Get ID of this object
         $ID = $this->ID;
     }
     return $ID >= $special_range[0] && $ID <= $special_range[1];
 }
Exemplo n.º 16
0
/**
 * Assert that the supplied post type can be used by the current user in
 * the post's extra categories' context.
 *
 * @param integer Item type ID
 * @param array The extra cats of the post.
 */
function check_perm_posttype($item_typ_ID, $post_extracats)
{
    global $Blog, $current_User;
    $ItemTypeCache =& get_ItemTypeCache();
    $ItemType =& $ItemTypeCache->get_by_ID($item_typ_ID);
    if (ItemType::is_reserved($ItemType->ID)) {
        // Don't allow to use a reserved post type:
        debug_die('This post type is reserved and cannot be used. Please choose another one.');
    }
    if (!$Blog->is_item_type_enabled($ItemType->ID)) {
        // Don't allow to use a not enabled post type:
        debug_die('This post type is not enabled. Please choose another one.');
    }
    // Check permission:
    $current_User->check_perm('cats_item_type_' . $ItemType->perm_level, 'edit', true, $post_extracats);
}
Exemplo n.º 17
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/../init.inc.php';
Template::SetTitle('首页');
$options = array('type_id' => (int) $_REQUEST['type']);
$itemType = ItemType::getList();
$itemList = Item::getList($options);
Template::assign('itemType', $itemType);
Template::assign('itemList', $itemList);
Template::display('list.tpl');
Exemplo n.º 18
0
        }
        break;
    case 'delete':
        if ($id) {
            $result = ItemType::deleteItem($id);
            $code = $result['code'];
            $msg = $result['msg'];
            $data = $result['data'];
        } else {
            $code = 1;
            $msg = "无效的id";
        }
        break;
    case 'get':
        $result = ItemType::getItemByID($id);
        $code = $result['code'];
        $msg = $result['msg'];
        $data = $result['data'][0];
        break;
    case 'list':
        break;
    case 'reload':
        $count = ItemType::count();
        $list = ItemType::getAllItem();
        Template::assign(array('p' => $p, 'total' => $count, 'items' => $list['data']));
        $data = Template::Render('op/typegrid.tpl');
        break;
    default:
        $code = 1;
        $msg = '没有这个操作';
}
Exemplo n.º 19
0
 */
if (!defined('EVO_MAIN_INIT')) {
    die('Please, do not access this page directly.');
}
load_class('items/model/_itemtype.class.php', 'ItemType');
global $dispatcher;
// Create query
$SQL = new SQL();
$SQL->SELECT('*');
$SQL->FROM('T_items__type');
// Create result set:
$Results = new Results($SQL->get(), 'ptyp_');
$Results->title = T_('Item/Post/Page types');
// get reserved ids
global $reserved_ids;
$reserved_ids = ItemType::get_reserved_ids();
/**
 * Callback to build possible actions depending on item type id
 *
 */
function get_actions_for_itemtype($id)
{
    global $reserved_ids;
    $action = action_icon(T_('Duplicate this item type...'), 'copy', regenerate_url('action', 'ptyp_ID=' . $id . '&amp;action=new'));
    if ($id < $reserved_ids[0] || $id > $reserved_ids[1]) {
        // not reserved id
        $action = action_icon(T_('Edit this item type...'), 'edit', regenerate_url('action', 'ptyp_ID=' . $id . '&amp;action=edit')) . $action . action_icon(T_('Delete this item type!'), 'delete', regenerate_url('action', 'ptyp_ID=' . $id . '&amp;action=delete&amp;' . url_crumb('itemtype') . ''));
    }
    return $action;
}
/**
Exemplo n.º 20
0
<?php

require_once $_SERVER['DOCUMENT_ROOT'] . '/../init.inc.php';
Template::SetTitle('首页');
if (isset($_REQUEST['type'])) {
    $options = array('type' => (int) $_REQUEST['type']);
}
$itemType = ItemType::getList($options);
Template::assign('itemType', $itemType);
Template::display('index.tpl');
Exemplo n.º 21
0
 /**
  * Is this an Intro post
  *
  * @return boolean
  */
 function is_intro()
 {
     return ItemType::is_intro($this->ityp_ID);
 }
Exemplo n.º 22
0
 function buildItem($id, $session, $reviseItem = false, $preview = false)
 {
     // fetch record from db
     $listing = ListingsModel::getItem($id);
     $post_id = $listing['post_id'];
     $profile_details = $listing['profile_data']['details'];
     $hasVariations = ProductWrapper::hasVariations($post_id);
     $isVariation = ProductWrapper::isSingleVariation($post_id);
     // remember listing id and account id for checkItem() and buildPayment()
     $this->listing_id = $id;
     $this->account_id = $listing['account_id'];
     // adjust profile details from product level options
     $profile_details = $this->adjustProfileDetails($id, $post_id, $profile_details);
     // create Item
     $item = new ItemType();
     // set quantity
     // $item->Quantity = $listing['quantity'];
     // get current quantity from WooCommerce
     $woocom_stock = ProductWrapper::getStock($post_id);
     // get max_quantity from profile
     $max_quantity = isset($profile_details['max_quantity']) && intval($profile_details['max_quantity']) > 0 ? $profile_details['max_quantity'] : PHP_INT_MAX;
     $item->Quantity = min($max_quantity, intval($woocom_stock));
     // handle fixed quantity
     if (intval($profile_details['quantity']) > 0) {
         $item->Quantity = $profile_details['quantity'];
     }
     if ($item->Quantity < 0) {
         $item->Quantity = 0;
     }
     // prevent error for negative qty
     // set listing title
     $item->Title = $this->prepareTitle($listing['auction_title']);
     // set listing duration
     $product_listing_duration = get_post_meta($post_id, '_ebay_listing_duration', true);
     $item->ListingDuration = $product_listing_duration ? $product_listing_duration : $listing['listing_duration'];
     // omit ListingType when revising item
     if (!$reviseItem) {
         $product_listing_type = get_post_meta($post_id, '_ebay_auction_type', true);
         $ListingType = $product_listing_type ? $product_listing_type : $listing['auction_type'];
         // handle classified ads
         if ($ListingType == 'ClassifiedAd') {
             $ListingType = 'LeadGeneration';
             $item->setListingSubtype2('ClassifiedAd');
         }
         $item->setListingType($ListingType);
     }
     // set eBay Site
     $item = $this->setEbaySite($item, $session);
     // add prices
     $item = $this->buildPrices($id, $item, $post_id, $profile_details, $listing);
     // add images
     $item = $this->buildImages($id, $item, $post_id, $profile_details, $session);
     // if this is a split variation, use parent post_id for all further processing
     if ($isVariation) {
         // prepare item specifics / variation attributes
         $this->prepareSplitVariation($id, $post_id, $listing);
         // use parent post_id for all further processing
         $post_id = ProductWrapper::getVariationParent($post_id);
     }
     // add various options from $profile_details
     $item = $this->buildProfileOptions($item, $profile_details);
     // add various options that depend on $profile_details and $post_id
     $item = $this->buildProductOptions($id, $item, $post_id, $profile_details, $listing, $hasVariations, $isVariation);
     // add payment and return options
     $item = $this->buildPayment($item, $profile_details);
     // add shipping services and options
     $item = $this->buildShipping($id, $item, $post_id, $profile_details, $listing, $isVariation);
     // add seller profiles
     $item = $this->buildSellerProfiles($id, $item, $post_id, $profile_details);
     // add ebay categories and store categories
     $item = $this->buildCategories($id, $item, $post_id, $profile_details);
     // add variations
     if ($hasVariations) {
         if (@$profile_details['variations_mode'] == 'flat') {
             // don't build variations - list as flat item
             $item = $this->flattenVariations($id, $item, $post_id, $profile_details);
         } else {
             // default: list as variations
             $item = $this->buildVariations($id, $item, $profile_details, $listing, $session);
         }
     }
     // add item specifics (attributes) - after variations
     $item = $this->buildItemSpecifics($id, $item, $listing, $post_id);
     // add part compatibility list
     $item = $this->buildCompatibilityList($id, $item, $listing, $post_id);
     // set listing description - after $item has been built
     $item->Description = $this->getFinalHTML($id, $item, $preview);
     // adjust item if this is a ReviseItem request
     if ($reviseItem) {
         $item = $this->adjustItemForRevision($id, $item, $profile_details, $listing);
     } else {
         $item = $this->buildSchedule($item, $profile_details);
     }
     // add UUID to prevent duplicate AddItem or RelistItem calls
     if (!$reviseItem) {
         // build UUID from listing Title, product_id, previous ItemID and today's date and hour
         $uuid_src = $item->Title . $post_id . $listing['ebay_id'] . date('Y-m-d h');
         $item->setUUID(md5($uuid_src));
         WPLE()->logger->info('UUID src: ' . $uuid_src);
     }
     // filter final item object before it's sent to eBay
     $item = apply_filters('wplister_filter_listing_item', $item, $listing, $profile_details, $post_id);
     $item = apply_filters('wple_filter_listing_item', $item, $listing, $profile_details, $post_id, $reviseItem);
     return $item;
 }
 /**
  * sample_AddItem::dispatchCall()
  * 
  * Dispatch the call
  * 
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $reqPic = new UploadSiteHostedPicturesRequestType();
     $reqPic->setPictureData(file_get_contents("/var/www/apache2-default/playground/johann/php5/Fotolia.jpg"));
     $reqPic->setPictureSet(PictureSetCodeType::CodeType_Supersize);
     $resPic = $this->proxy->UploadSiteHostedPictures($reqPic);
     if ($this->testValid($resPic)) {
         $pictureUrl = $resPic->getSiteHostedPictureDetails()->getFullURL();
         $reqItem = new AddItemRequestType();
         $item = new ItemType();
         $item->setTitle('ipod');
         $item->setQuantity(1);
         $item->setCurrency('EUR');
         $item->setCountry('DE');
         $item->setStartPrice('5.00');
         $item->setListingDuration('Days_7');
         $item->setLocation('Cologne');
         $item->setPaymentMethods('CashOnPickup');
         $item->setListingType('Chinese');
         $item->setDescription('Neuer iPod mit Kopfhörer Ladekabel und Pc-Anschlusskabel.');
         $item->setSubTitle('Brandneuer iPod Mini!');
         $item->setHitCounter('BasicStyle');
         $item->setListingEnhancement('Highlight');
         $listingDesigner = new ListingDesignerType();
         $listingDesigner->setLayoutID('7710001');
         $listingDesigner->setThemeID('7730714');
         $item->setListingDesigner($listingDesigner);
         $primaryCategory = new CategoryType();
         $primaryCategory->setCategoryID(10610);
         $item->setPrimaryCategory($primaryCategory);
         $secondaryCategory = new CategoryType();
         $secondaryCategory->setCategoryID(8267);
         $item->setSecondaryCategory($secondaryCategory);
         $picture = new PictureDetailsType();
         $picture->setPictureURL($pictureUrl);
         $item->setPictureDetails($picture);
         $attSet = new AttributeSetType();
         $attSet->setTypeAttribute('attributeSetID', 1950);
         $att = new AttributeType();
         $att->setTypeAttribute('attributeID', 10244);
         $attValue = new ValType();
         $attValue->setValueID(10426);
         $att->setValue($attValue, 0);
         $attSet->setAttribute($att, 0);
         $atts = new AttributeSetArrayType();
         $atts->setAttributeSet($attSet, 0);
         $attSet2 = new AttributeSetType();
         $attSet2->setTypeAttribute('attributeSetID', 2136);
         $att2 = new AttributeType();
         $att2->setTypeAttribute('attributeID', 3803);
         $attValue2 = new ValType();
         $attValue2->setValueID(32040);
         $att2->setValue($attValue2, 0);
         $att3 = new AttributeType();
         $att3->setTypeAttribute('attributeID', 3806);
         $attValue3 = new ValType();
         $attValue3->setValueID(-3);
         $attValue3->setValueLiteral('siehe Artikelbeschreibung');
         $att3->setValue($attValue3, 0);
         $attSet2->setAttribute($att3, 1);
         $atts->setAttributeSet($attSet2, 1);
         $item->setAttributeSetArray($atts);
         $reqItem->setItem($item);
         $resItem = $this->proxy->AddItem($reqItem);
         if ($this->testValid($resItem)) {
             $this->dumpObject($resItem);
             return true;
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
 /**
  * sample_AddItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $a = new ShippingServiceOptionsType();
     $a->setShippingService('UPS2ndDay');
     $a->setShippingServicePriority('1');
     $a->setShippingServiceCost('5');
     $b = new ShippingDetailsType();
     //print '<pre>'.print_r(get_class_methods($b),true).'</pre><br>';
     $b->setShippingServiceOptions($a);
     //$b->setDefaultShippingCost(5);
     $b->setShippingType('Flat');
     $req = new AddItemRequestType();
     $item = new ItemType();
     $item->setTitle($params['Title']);
     $item->setQuantity($params['Quantity']);
     $item->setCurrency($params['Currency']);
     $item->setCountry($params['Country']);
     $item->setStartPrice($params['StartPrice']);
     $item->setListingDuration($params['ListingDuration']);
     $item->setLocation($params['Location']);
     $item->setPaymentMethods($params['PaymentMethods']);
     $item->setListingType($params['ListingType']);
     $item->setDescription($params['Description']);
     $item->ShippingService = 'UPS Ground';
     $item->setShippingDetails($b);
     //print '<pre>'.print_r(get_class_methods($a),true).'</pre><br>';
     //$this->dumpObject($a);
     //$this->dumpObject($item);
     $primaryCategory = new CategoryType();
     $primaryCategory->setCategoryID($params['CategoryID']);
     $item->setPrimaryCategory($primaryCategory);
     $req->setItem($item);
     $res = $this->proxy->AddItem($req);
     $this->dumpObject($res);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 25
0
 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      ItemType $value A ItemType object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(ItemType $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
 /**
  * sample_VerifyAddItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $req = new VerifyAddItemRequestType();
     $item = new ItemType();
     $item->setTitle($params['Title']);
     $item->setQuantity($params['Quantity']);
     $item->setCurrency($params['Currency']);
     $item->setCountry($params['Country']);
     $item->setStartPrice($params['StartPrice']);
     $item->setListingDuration($params['ListingDuration']);
     $item->setLocation($params['Location']);
     $item->setPaymentMethods($params['PaymentMethods']);
     $item->setListingType($params['ListingType']);
     $item->setDescription($params['Description']);
     $primaryCategory = new CategoryType();
     $primaryCategory->setCategoryID($params['CategoryID']);
     $item->setPrimaryCategory($primaryCategory);
     $req->setItem($item);
     $res = $this->proxy->VerifyAddItem($req);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
 /**
  * sample_AddItem::dispatchCall()
  * 
  * Dispatch the call
  *
  * @param array $params array of parameters for the eBay API call
  * 
  * @return boolean success
  */
 public function dispatchCall($params)
 {
     $req = new AddItemRequestType();
     $item = new ItemType();
     $item->setTitle($params['Title']);
     $item->setQuantity($params['Quantity']);
     $item->setCurrency($params['Currency']);
     $item->setCountry($params['Country']);
     $item->setStartPrice($params['StartPrice']);
     $item->setListingDuration($params['ListingDuration']);
     $item->setLocation($params['Location']);
     $item->setPaymentMethods($params['PaymentMethods']);
     $item->setListingType($params['ListingType']);
     $item->setDescription($params['Description']);
     $item->setSubTitle($params['SubTitle']);
     $item->setHitCounter($params['HitCounter']);
     $item->setListingEnhancement($params['ListingEnhancement']);
     $listingDesigner = new ListingDesignerType();
     $listingDesigner->setLayoutID($params['LayoutID']);
     $listingDesigner->setThemeID($params['ThemeID']);
     $item->setListingDesigner($listingDesigner);
     $primaryCategory = new CategoryType();
     $primaryCategory->setCategoryID($params['CategoryID']);
     $item->setPrimaryCategory($primaryCategory);
     $secondaryCategory = new CategoryType();
     $secondaryCategory->setCategoryID($params['secondaryCategoryID']);
     $item->setSecondaryCategory($secondaryCategory);
     $picture = new PictureDetailsType();
     $picture->setPictureURL($params['PictureURL']);
     $item->setPictureDetails($picture);
     $req->setItem($item);
     $res = $this->proxy->AddItem($req);
     if ($this->testValid($res)) {
         $this->dumpObject($res);
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 28
0
 public function addToRecipients($recipient)
 {
     if (is_string($recipient)) {
         $address = new Mailbox();
         $address->setEmailAddress($recipient);
         $recipient = $address;
     }
     return parent::addToRecipients($recipient);
 }
Exemplo n.º 29
0
function ityp_row_perm_level($level, $id)
{
    if (ItemType::is_reserved($id)) {
        // It is reserved item type, Don't display perm level
        return '';
    }
    $perm_levels = array('standard' => T_('Standard'), 'restricted' => T_('Restricted'), 'admin' => T_('Admin'));
    return isset($perm_levels[$level]) ? $perm_levels[$level] : $level;
}
Exemplo n.º 30
0
 /**
  * Declares an association between this object and a ItemType object.
  *
  * @param      ItemType $v
  * @return     Item The current object (for fluent API support)
  * @throws     PropelException
  */
 public function setItemType(ItemType $v = null)
 {
     if ($v === null) {
         $this->setItemTypeId(NULL);
     } else {
         $this->setItemTypeId($v->getId());
     }
     $this->aItemType = $v;
     // Add binding for other direction of this n:n relationship.
     // If this object has already been added to the ItemType object, it will not be re-added.
     if ($v !== null) {
         $v->addItem($this);
     }
     return $this;
 }