Exemplo n.º 1
0
    public function uninstall()
    {
        if ($payment = $this->Payment()) {
            $payment->delete();
        }

        return parent::uninstall();
    }
Exemplo n.º 2
0
 /**
  * Uninstalled the plugin.
  *
  * Deletes the payment row.
  *
  * @return bool
  */
 public function uninstall()
 {
     if ($payment = $this->Payment()) {
         $sql = 'DELETE FROM `s_core_rulesets` WHERE `paymentID`=?';
         Shopware()->Db()->query($sql, array($payment->getId()));
         $sql = 'DELETE FROM `s_core_paymentmeans_countries` WHERE `paymentID`=?';
         Shopware()->Db()->query($sql, array($payment->getId()));
         $sql = 'DELETE FROM `s_core_paymentmeans_subshops` WHERE `paymentID`=?';
         Shopware()->Db()->query($sql, array($payment->getId()));
     }
     $sql = 'DELETE FROM `s_core_documents_box` WHERE `name` LIKE ?';
     Shopware()->Db()->query($sql, array('Billsafe_%'));
     return parent::uninstall();
 }
Exemplo n.º 3
0
	/**
	 * Standard uninstall method which removes the trusted shops db tables
	 * @return boolean
	 */
	public function uninstall()
	{
		$sql = "DELETE FROM s_core_states WHERE description LIKE 'TS - Antrag%'";
		Shopware()->Db()->query($sql);

		return parent::uninstall();
	}
 /**
  * Performs the necessary uninstall steps
  *
  * @return boolean
  */
 public function uninstall()
 {
     $translationHelper = new Shopware_Plugins_Frontend_PaymPaymentCreditcard_Components_TranslationHelper(null);
     $translationHelper->dropSnippets();
     $this->removeSnippets();
     return parent::uninstall();
 }
Exemplo n.º 5
0
 /**
  * Uninstall method of the plugin. The plugin database table will be dropped.
  *
  * @return bool
  */
 public function uninstall()
 {
     $sql = 'DROP TABLE IF EXISTS `s_plugin_migrations`;';
     $this->db->query($sql);
     return parent::uninstall();
 }
Exemplo n.º 6
0
 /**
  * Standard uninstall method which removes the trusted shops db tables
  *
  * @return boolean
  */
 public function uninstall()
 {
     $sql = "DELETE FROM s_core_states\n\t\t\t\tWHERE description LIKE 'TS - Antrag%'";
     $this->db->query($sql);
     $sql = "DELETE FROM s_crontab\n\t\t\t\tWHERE pluginID = ?";
     $this->db->query($sql, array($this->getId()));
     return parent::uninstall();
 }
Exemplo n.º 7
0
 /**
  * Plugin unistall method
  *
  * @return	bool
  */
 public function uninstall() {
     try {
         $piKlarnaInvoiceId = piKlarnaGetInvoicePaymentId();
         $piKlarnaRateId = piKlarnaGetRatePaymentId();
         $piKlarnaPluginId = piKlarnaGetPluginId();
         $sql = "DELETE FROM s_core_rulesets WHERE paymentID = ? OR paymentID = ?";
         Shopware()->Db()->query($sql, array((int)$piKlarnaInvoiceId, (int)$piKlarnaRateId));
         $sql = "DELETE FROM s_core_paymentmeans WHERE name IN ('KlarnaInvoice','KlarnaPartPayment')";
         Shopware()->Db()->query($sql);
         $sql = "DELETE FROM s_core_states
                 WHERE description IN
                 (
                     '<span style=\"color:orange\">Zahlung wird von Klarna gepr&uuml;ft</span>',
                     '<span style=\"color:green\">Zahlung von Klarna akzeptiert</span>',
                     '<span style=\"color:red\">Zahlung von Klarna nicht akzeptiert</span>',
                     '<span style=\"color:red\">Reservierung abgebrochen</span>',
                     '<span style=\"color:orange\">Reservierung teilweise aktiviert</span>',
                     '<span style=\"color:green\">Reservierung komplett aktiviert</span>',
                     '<span style=\"color:orange\">Teilweise retourniert</span>',
                     '<span style=\"color:red\">Komplett retourniert</span>',
                     '<span style=\"color:orange\">Teilweise storniert</span>',
                     '<span style=\"color:red\">Komplett storniert</span>'
                 )";    
         Shopware()->Db()->query($sql);
         return parent::uninstall();
     }
     catch (Exception $e) {
         throw new Exception('Fehler beim deinstallieren(uninstall)');
     }
     return true;
 }
Exemplo n.º 8
0
 /**
  * Registers a plugin in the collection.
  * If $removeData is set to false the plugin data will not be removed.
  *
  * @param Shopware_Components_Plugin_Bootstrap $bootstrap
  * @param bool $removeData
  * @return bool
  * @throws Exception
  */
 public function uninstallPlugin(Shopware_Components_Plugin_Bootstrap $bootstrap, $removeData = true)
 {
     /** @var \Shopware\Components\Model\ModelManager $em */
     $em = $this->Application()->Models();
     /** @var \Enlight_Components_Db_Adapter_Pdo_Mysql $db */
     $db = $this->Application()->Db();
     $id = $this->getPluginId($bootstrap->getName());
     $plugin = $em->find('Shopware\\Models\\Plugin\\Plugin', $id);
     $this->Application()->Events()->notify('Shopware_Plugin_PreUninstall', array('subject' => $this, 'plugin' => $bootstrap, 'removeData' => $removeData));
     $result = $bootstrap->disable();
     $capabilities = $bootstrap->getCapabilities();
     $capabilities['secureUninstall'] = !empty($capabilities['secureUninstall']);
     $success = is_bool($result) ? $result : !empty($result['success']);
     if (!$success) {
         return $result;
     }
     $this->Application()->Events()->notify('Shopware_Plugin_PostUninstall', array('subject' => $this, 'plugin' => $bootstrap, 'removeData' => $removeData));
     if ($removeData) {
         $result = $bootstrap->uninstall();
     } elseif ($capabilities['secureUninstall']) {
         $result = $bootstrap->secureUninstall();
     } else {
         throw new \Exception('Plugin does not support secure uninstall.');
     }
     $this->Application()->Events()->notify('Shopware_Plugin_PostUninstall', array('subject' => $this, 'plugin' => $bootstrap, 'removeData' => $removeData));
     $success = is_bool($result) ? $result : !empty($result['success']);
     if (!$success) {
         return $result;
     }
     $plugin->setInstalled(null);
     $plugin->setActive(false);
     $em->flush($plugin);
     // Remove event subscribers
     $sql = 'DELETE FROM `s_core_subscribes` WHERE `pluginID`=?';
     $db->query($sql, array($id));
     // Remove crontab-entries
     $sql = 'DELETE FROM `s_crontab` WHERE `pluginID`=?';
     $db->query($sql, array($id));
     // Remove form
     $this->removeForm($bootstrap, $removeData);
     // Remove snippets
     if ($capabilities['secureUninstall']) {
         $bootstrap->removeSnippets($removeData);
     } else {
         $bootstrap->removeSnippets(true);
     }
     // Remove menu-entry
     $query = 'DELETE FROM Shopware\\Models\\Menu\\Menu m WHERE m.pluginId = ?0';
     $query = $em->createQuery($query);
     $query->execute(array($id));
     // Remove templates
     $query = 'DELETE FROM Shopware\\Models\\Shop\\Template t WHERE t.pluginId = ?0';
     $query = $em->createQuery($query);
     $query->execute(array($id));
     // Remove emotion-components
     $sql = "DELETE s_emotion_element_value, s_emotion_element\n                FROM s_emotion_element_value\n                RIGHT JOIN s_emotion_element\n                    ON s_emotion_element.id = s_emotion_element_value.elementID\n                INNER JOIN s_library_component\n                    ON s_library_component.id = s_emotion_element.componentID\n                    AND s_library_component.pluginID = :pluginId";
     $db->query($sql, array(':pluginId' => $id));
     $sql = "DELETE s_library_component_field, s_library_component\n                FROM s_library_component_field\n                INNER JOIN s_library_component\n                    ON s_library_component.id = s_library_component_field.componentID\n                    AND s_library_component.pluginID = :pluginId";
     $db->query($sql, array(':pluginId' => $id));
     $this->removePluginWidgets($id);
     return $result;
 }
Exemplo n.º 9
0
    /**
     * Registers a plugin in the collection.
     *
     * @param   Shopware_Components_Plugin_Bootstrap $plugin
     * @return  bool
     */
    public function uninstallPlugin(Shopware_Components_Plugin_Bootstrap $plugin)
    {
        $result = $plugin->disable();
        $success = is_bool($result) ? $result : !empty($result['success']);
        if($success) {
            $result = $plugin->uninstall();
            $success = is_bool($result) ? $result : !empty($result['success']);
        }
        if ($success) {
            $id = $plugin->getId();
            $data = array(
                'installation_date' => NULL,
                'active' => 0
            );
            $this->Application()->Db()->update('s_core_plugins', $data, array('id=?' => $id));

            $sql = 'DELETE FROM `s_core_subscribes` WHERE `pluginID`=?';
            $this->Application()->Db()->query($sql, array($id));

            $sql = 'DELETE FROM `s_crontab` WHERE `pluginID`=?';
            $this->Application()->Db()->query($sql, array($id));

            /** @var $em Shopware\Components\Model\ModelManager */
            $em = $this->Application()->Models();

            if($plugin->hasForm()) {
                $form = $plugin->Form();
                if($form->getId()) {
                    $em->remove($form);
                } else {
                    $em->detach($form);
                }
                $em->flush();
            }

            $query = 'DELETE FROM Shopware\Models\Menu\Menu m WHERE m.pluginId = ?0';
            $query = $em->createQuery($query);
            $query->execute(array($id));

            $query = 'DELETE FROM Shopware\Models\Shop\Template t WHERE t.pluginId = ?0';
            $query = $em->createQuery($query);
            $query->execute(array($id));
        }
        return $result;
    }
Exemplo n.º 10
0
 /**
  * Uninstalls the Plugin and its components
  *
  * @return boolean
  */
 public function uninstall()
 {
     $this->disable();
     $this->_dropDatabaseTables();
     return parent::uninstall();
 }
Exemplo n.º 11
0
 /**
  * Uninstalls the menu-item
  *
  * @return bool|void
  */
 public function uninstall()
 {
     $sql = "DELETE FROM s_cms_static\n                WHERE link='GlossarInventory'";
     Shopware()->Db()->query($sql);
     return parent::uninstall();
 }
Exemplo n.º 12
0
 /**
  * Registers a plugin in the collection.
  *
  * @param   Shopware_Components_Plugin_Bootstrap $bootstrap
  * @return  bool
  */
 public function uninstallPlugin(Shopware_Components_Plugin_Bootstrap $bootstrap)
 {
     /** @var \Shopware\Components\Model\ModelManager $em */
     $em = $this->Application()->Models();
     /** @var \Enlight_Components_Db_Adapter_Pdo_Mysql $db */
     $db = $this->Application()->Db();
     $id = $this->getPluginId($bootstrap->getName());
     $plugin = $em->find('Shopware\\Models\\Plugin\\Plugin', $id);
     $this->Application()->Events()->notify('Shopware_Plugin_PreUninstall', array('subject' => $this, 'plugin' => $bootstrap));
     $result = $bootstrap->disable();
     $success = is_bool($result) ? $result : !empty($result['success']);
     if ($success) {
         $result = $bootstrap->uninstall();
         $this->Application()->Events()->notify('Shopware_Plugin_PostUninstall', array('subject' => $this, 'plugin' => $bootstrap));
         $success = is_bool($result) ? $result : !empty($result['success']);
     }
     if ($success) {
         $plugin->setInstalled(null);
         $plugin->setActive(false);
         $em->flush($plugin);
         // Remove event subscribers
         $sql = 'DELETE FROM `s_core_subscribes` WHERE `pluginID`=?';
         $db->query($sql, array($id));
         // Remove crontab-entries
         $sql = 'DELETE FROM `s_crontab` WHERE `pluginID`=?';
         $db->query($sql, array($id));
         // Remove form
         if ($bootstrap->hasForm()) {
             $form = $bootstrap->Form();
             if ($form->getId()) {
                 $em->remove($form);
             } else {
                 $em->detach($form);
             }
             $em->flush();
         }
         // Remove menu-entry
         $query = 'DELETE FROM Shopware\\Models\\Menu\\Menu m WHERE m.pluginId = ?0';
         $query = $em->createQuery($query);
         $query->execute(array($id));
         // Remove templates
         $query = 'DELETE FROM Shopware\\Models\\Shop\\Template t WHERE t.pluginId = ?0';
         $query = $em->createQuery($query);
         $query->execute(array($id));
         // Remove emotion-components
         $sql = "DELETE s_emotion_element\n                    FROM s_emotion_element\n                    INNER JOIN s_library_component\n                        ON s_library_component.id = s_emotion_element.componentID\n                        AND s_library_component.pluginID = :pluginId";
         $db->query($sql, array(':pluginId' => $id));
         $sql = "DELETE s_library_component_field, s_library_component\n                    FROM s_library_component_field\n                    INNER JOIN s_library_component\n                        ON s_library_component.id = s_library_component_field.componentID\n                        AND s_library_component.pluginID = :pluginId";
         $db->query($sql, array(':pluginId' => $id));
         $this->removePluginWidgets($id);
     }
     return $result;
 }
Exemplo n.º 13
0
 /**
  * Shopware method automatically getting called for plugin Uninstallation
  *
  * @return boolean Indicator of success
  */
 public function uninstall()
 {
     $result = false;
     if (parent::uninstall()) {
         $installer = new Shopware_Plugins_Frontend_SofortPayment_Components_Services_Setup($this);
         $installer->uninstall();
         $result = true;
     }
     return array('success' => $result, 'invalidateCache' => array('backend'));
 }