Ejemplo n.º 1
0
 /**
  * Constructs a new placeholder class and use the object to fill
  * the placeholder with.
  * 
  * @param unknown $object
  */
 public function __construct($object, $begin = "<<", $end = ">>")
 {
     $replace = array();
     if ($object instanceof Part) {
         $replace = array('id' => $object->getId(), 'barcodeId' => $object->getId() * 10 + 1, 'name' => $object->getName(), 'internalNumber' => $object->getInternalPartNumber(), 'description' => $object->getDescription(), 'categoryFull' => $object->getCategory()->getCategoryPath(), 'categoryLast' => $object->getCategory()->getName(), 'footprintName' => $object->getFootprint() === null ? '' : $object->getFootprint()->getName(), 'storageLocationName' => $object->getStorageLocation() === null ? '' : $object->getStorageLocation()->getName());
     } else {
         if ($object instanceof StorageLocation) {
             $replace = array('id' => $object->getId(), 'barcodeId' => $object->getId() * 10 + 2, 'name' => $object->getName());
         }
     }
     $this->beginToken = $begin;
     $this->endToken = $end;
     $this->replacements = $replace;
 }
Ejemplo n.º 2
0
 /**
  * Hydrate the update form for this object, before passing it to the update template
  *
  * @param unknown $object
  */
 protected function hydrateObjectForm($object)
 {
     $data = array('name' => $object->getName());
     return new AreaModificationForm($this->getRequest(), 'form', $data);
 }
Ejemplo n.º 3
0
 /**
  *
  * @param unknown $item
  * @return Customweb_Payment_Authorization_IInvoiceItem
  */
 public function getProductItem($item, $useBaseCurrency = false)
 {
     if ($item instanceof Mage_Sales_Model_Order_Item || $item instanceof Mage_Sales_Model_Quote_Item) {
         $orderItem = $item;
     } else {
         $orderItem = $item->getOrderItem();
     }
     $sku = $item->getSku();
     $name = $item->getName();
     $taxRate = $orderItem->getTaxPercent();
     $quantity = $item->getQty();
     if (!$quantity) {
         $quantity = $orderItem->getQtyOrdered();
     }
     if ($useBaseCurrency) {
         $amountIncludingTax = $item->getBaseRowTotalInclTax();
     } else {
         $amountIncludingTax = $item->getRowTotalInclTax();
     }
     $type = Customweb_Payment_Authorization_IInvoiceItem::TYPE_PRODUCT;
     $invoiceItem = new Customweb_Payment_Authorization_DefaultInvoiceItem($sku, $name, (double) $taxRate, (double) $amountIncludingTax, (double) $quantity, $type);
     return $invoiceItem;
 }
Ejemplo n.º 4
0
 /**
  * Prepare index progress message
  * @param unknown $store
  * @param int $totalMagentoProductsByStore
  * @param boolean $update
  */
 public function prepareIndexProgressMessage($store, $totalMagentoProductsByStore, $update = false)
 {
     if ($update) {
         $this->messages[] = Mage::helper('solrsearch')->__('Posted %s/%s/%s products to Solr', $this->totalFetchedProducts, $totalMagentoProductsByStore, $this->totalMagentoProducts);
     } else {
         $this->messages[] = Mage::helper('solrsearch')->__('Posted %s/%s products to Solr', $this->totalFetchedProducts, $this->totalMagentoProducts);
     }
     $this->messages[] = Mage::helper('solrsearch')->__('Current Solr indexed: %s documents/%s products', $this->totalSolrDocuments, $this->totalMagentoProducts);
     $this->messages[] = Mage::helper('solrsearch')->__('Progress: %s', $this->percent . '%');
     $this->messages[] = Mage::helper('solrsearch')->__('Current store: %s(%s/%s products)', $store->getName(), $this->totalFetchedProductsByStore, $totalMagentoProductsByStore);
     $this->response['remaintime'] = $this->calculateRemainTime();
     $this->messages[] = Mage::helper('solrsearch')->__('Continue...');
     $this->messages[] = Mage::helper('solrsearch')->__('------------------------------------------------');
 }