Ejemplo n.º 1
0
            getContact($_POST['username'], $authuser, $authpw, $contactID);
            break;
        case 'addEditContact':
            addEditContact($_POST['username'], $authuser, $authpw, $contactName, $contactID);
            break;
        case 'removeContact':
            removeContact($_POST['username'], $authuser, $authpw, $contactID);
            break;
        case 'getContactAttributes':
            getContactAttributes($_POST['username'], $authuser, $authpw, $contactID);
            break;
        case 'getContactAttribute':
            getContactAttribute($_POST['username'], $authuser, $authpw, $attributeName);
            break;
        case 'updateAttribute':
            updateAttribute($_POST['username'], $authuser, $authpw, $contactName, $contactID);
            break;
        case 'deleteAttribute':
            deleteAttribute($_POST['username'], $authuser, $authpw, $attributeName);
            break;
    }
}
/*
 * 4.2.1.Create a new subscription for address book changes
 * HTTP POST http://{serverRoot}/addressbook/{apiVersion}/{userId}/subscriptions/abChanges
 */
function postSubscription($username, $authuser, $authpw)
{
    //NOT WORKING
    global $SERVER_URL, $APIVERSION;
    $url = $SERVER_URL . 'addressbook/' . $APIVERSION . '/' . $username . '/subscriptions/abChanges';
 * It is also available through the world-wide-web at this URL:
 * http://ecommerce.aheadworks.com/AW-LICENSE.txt
 *
 * =================================================================
 *                 MAGENTO EDITION USAGE NOTICE
 * =================================================================
 * This package designed for Magento enterprise edition
 * aheadWorks does not guarantee correct work of this extension
 * on any other Magento edition except Magento enterprise edition.
 * aheadWorks does not provide extension support in case of
 * incorrect edition usage.
 * =================================================================
 *
 * @category   AW
 * @package    AW_Onsale
 * @version    2.4.0
 * @copyright  Copyright (c) 2010-2012 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/AW-LICENSE.txt
 */
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
if (!function_exists('updateAttribute')) {
    function updateAttribute(Mage_Eav_Model_Entity_Setup $setup, $entityTypeId, $code, $key, $value)
    {
        $id = $setup->getAttribute($entityTypeId, $code, 'attribute_id');
        $setup->updateAttribute($entityTypeId, $id, $key, $value);
    }
}
updateAttribute($setup, 'catalog_product', 'created_at', 'used_in_product_listing', '1');
$installer->endSetup();
 * aheadWorks does not provide extension support in case of
 * incorrect edition usage.
 * =================================================================
 *
 * @category   AW
 * @package    AW_Onsale
 * @version    2.4.0
 * @copyright  Copyright (c) 2010-2012 aheadWorks Co. (http://www.aheadworks.com)
 * @license    http://ecommerce.aheadworks.com/AW-LICENSE.txt
 */
$installer = $this;
$installer->startSetup();
$setup = new Mage_Eav_Model_Entity_Setup('core_setup');
if (!function_exists('updateAttribute')) {
    function updateAttribute(Mage_Eav_Model_Entity_Setup $setup, $entityTypeId, $code, $key, $value)
    {
        $id = $setup->getAttribute($entityTypeId, $code, 'attribute_id');
        $setup->updateAttribute($entityTypeId, $id, $key, $value);
    }
}
updateAttribute($setup, 'catalog_product', 'aw_os_product_display', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_product_position', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_product_image', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_product_text', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_product_image_path', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_category_display', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_category_position', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_category_image', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_category_text', 'used_in_product_listing', '1');
updateAttribute($setup, 'catalog_product', 'aw_os_category_image_path', 'used_in_product_listing', '1');
$installer->endSetup();
Ejemplo n.º 4
0
 $newDescription = stripString2($_POST["attributeDescription"]);
 if ($newCode == '') {
     die("An attribute must have a code");
 }
 if ($newName == '') {
     die("An attribute must have a name");
 }
 //Is this a new attribute?
 if ($isNewAttribute) {
     $result = createAttribute($newCode, $newName, $newDescription);
     $attributeID = intval($result[0]);
     $error = $result[1];
 } else {
     $attributeID = intval($_POST["id"]);
     if ($newCode != $_POST["oldAttributeCode"] || $newName != $_POST["oldAttributeName"] || $newDescription != $_POST["oldAttributeDescription"]) {
         $error = updateAttribute($attributeID, $newCode, $newName, $newDescription);
     }
 }
 $labelChanges = array();
 for ($i = 0; $i < $maxLabels; $i++) {
     //If nothing changed, skip this label
     $code = emptyAsNull(stripString1($_POST["labelCode"][$i]));
     $nameChange = $code != null && $_POST["oldLabelName"][$i] == '' || $_POST["labelName"][$i] != $_POST["oldLabelName"][$i];
     $descChange = $_POST["labelDescription"][$i] != $_POST["oldLabelDescription"][$i];
     $delete = checkDelete($code);
     if ($code == null || !($nameChange || $descChange || $delete)) {
         continue;
     }
     $labelID = intval($_POST["labelID"][$i]);
     $change = new LabelUpdate();
     $change->id = $labelID;