Permalink
Browse files

The backend now lists new orders on the welcome screen (#2111)

  • Loading branch information...
1 parent 704a1bb commit 48b37fc28044fda2b83e59bb3b70f3764abb310f @aschempp aschempp committed Jun 23, 2012
@@ -10,7 +10,8 @@ Version 1.4.beta1 (2012-??-??)
- Added support for frontend-only attributes
- Added new attribute type "upload"
- Can now manage order status in the backend and notify on status changes
-- Added support for i18nl10n extension
+- Support for i18nl10n extension
+- The backend now lists new orders on the welcome screen (#2111)
### Improved
- Checkout steps are now a numbered list (#3040)
@@ -511,5 +511,23 @@ public function addAttributesToDBUpdate($arrData)
return $arrData;
}
+
+
+ /**
+ * Show messages for new order status
+ * @return string
+ */
+ public function getOrderMessages()
+ {
+ $arrMessages = array();
+ $objOrders = $this->Database->query("SELECT COUNT(*) AS total, s.name FROM tl_iso_orders o LEFT JOIN tl_iso_orderstatus s ON o.status=s.id GROUP BY s.id");
+
+ while ($objOrders->next())
+ {
+ $arrMessages[] = '<p class="tl_new">' . sprintf($GLOBALS['ISO_LANG']['MSC']['newOrders'], $objOrders->total, $objOrders->name) . '</p>';
+ }
+
+ return implode("\n", $arrMessages);
+ }
}
@@ -288,6 +288,7 @@
$GLOBALS['TL_HOOKS']['executePreActions'][] = array('ProductTree', 'executePreActions');
$GLOBALS['TL_HOOKS']['executePostActions'][] = array('ProductTree', 'executePostActions');
$GLOBALS['TL_HOOKS']['translateUrlParameters'][] = array('IsotopeFrontend', 'translateProductUrls');
+$GLOBALS['TL_HOOKS']['getSystemMessages'][] = array('IsotopeBackend', 'getOrderMessages');
$GLOBALS['ISO_HOOKS']['buttons'][] = array('Isotope', 'defaultButtons');
$GLOBALS['ISO_HOOKS']['checkoutSurcharge'][] = array('IsotopeFrontend', 'getShippingAndPaymentSurcharges');
$GLOBALS['TL_HOOKS']['sqlGetFromFile'][] = array('IsotopeBackend', 'addAttributesToDBUpdate');
@@ -589,6 +589,7 @@ CREATE TABLE `tl_iso_orderstatus` (
`sorting` int(10) unsigned NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`paid` char(1) NOT NULL default '',
+ `welcomescreen` char(1) NOT NULL default '',
`mail_customer` int(10) unsigned NOT NULL default '0',
`mail_admin` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
@@ -107,7 +107,7 @@ private function exec($function)
<h1>Isotope eCommerce Update was not run successfully!</h1>
-<pre>' . $e->getMessage() . '</pre>
+<pre style="white-space:normal">' . $e->getMessage() . '</pre>
</div>
@@ -547,6 +547,7 @@ private function initializeOrderStatus()
`sorting` int(10) unsigned NOT NULL default '0',
`name` varchar(255) NOT NULL default '',
`paid` char(1) NOT NULL default '',
+ `welcomescreen` char(1) NOT NULL default '',
`mail_customer` int(10) unsigned NOT NULL default '0',
`mail_admin` int(10) unsigned NOT NULL default '0',
PRIMARY KEY (`id`),
@@ -580,7 +581,7 @@ private function initializeOrderStatus()
foreach( $arrStatus as $i => $status )
{
$strLabel = $GLOBALS['TL_LANG']['ORDER'][$status] == '' ? $status : $GLOBALS['TL_LANG']['ORDER'][$status];
- $intId = $this->Database->prepare("INSERT INTO tl_iso_orderstatus (tstamp,sorting,name,paid) VALUES ($time,?,?,?)")->executeUncached(($i*128), $strLabel, ($status == 'complete' ? '1' : ''))->insertId;
+ $intId = $this->Database->prepare("INSERT INTO tl_iso_orderstatus (tstamp,sorting,name,paid,welcomescreen) VALUES ($time,?,?,?,?)")->executeUncached(($i*128), $strLabel, ($status == 'complete' ? '1' : ''), ($status == 'pending' ? '1' : ''))->insertId;
$this->Database->prepare("UPDATE tl_iso_orders SET status=? WHERE status=?")->executeUncached($intId, $status);
$this->Database->prepare("UPDATE tl_iso_payment_modules SET new_order_status=? WHERE new_order_status=?")->executeUncached($intId, $status);
@@ -129,7 +129,7 @@
// Palettes
'palettes' => array
(
- 'default' => '{name_legend},name,paid;{email_legend},mail_customer,mail_admin',
+ 'default' => '{name_legend},name,paid,welcomescreen;{email_legend},mail_customer,mail_admin',
),
// Fields
@@ -139,13 +139,19 @@
(
'label' => &$GLOBALS['TL_LANG']['tl_iso_orderstatus']['name'],
'inputType' => 'text',
- 'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'w50'),
+ 'eval' => array('mandatory'=>true, 'maxlength'=>255, 'tl_class'=>'clr'),
),
'paid' => array
(
'label' => &$GLOBALS['TL_LANG']['tl_iso_orderstatus']['paid'],
'inputType' => 'checkbox',
- 'eval' => array('tl_class'=>'w50 m12'),
+ 'eval' => array('tl_class'=>'w50'),
+ ),
+ 'welcomescreen' => array
+ (
+ 'label' => &$GLOBALS['TL_LANG']['tl_iso_orderstatus']['welcomescreen'],
+ 'inputType' => 'checkbox',
+ 'eval' => array('tl_class'=>'w50'),
),
'mail_customer' => array
(
@@ -446,4 +446,5 @@
*/
$GLOBALS['ISO_LANG']['MSC']['templateConfig'] = '%s (Shop-Konfiguration: %s)';
$GLOBALS['ISO_LANG']['MSC']['templateTheme'] = '%s (Theme: %s)';
+$GLOBALS['ISO_LANG']['MSC']['newOrders'] = 'Sie haben %s Bestellung(en) mit Status "%s"';
@@ -248,6 +248,7 @@
$GLOBALS['ISO_LANG']['MSC']['templateConfig'] = '%s (Store Config: %s)';
$GLOBALS['ISO_LANG']['MSC']['templateTheme'] = '%s (Theme: %s)';
$GLOBALS['ISO_LANG']['MSC']['splittedTaxRate'] = 'Splitted';
+$GLOBALS['ISO_LANG']['MSC']['newOrders'] = 'You have %s order(s) with status "%s"';
/**
@@ -32,6 +32,7 @@
*/
$GLOBALS['TL_LANG']['tl_iso_orderstatus']['name'] = array('Name', 'Please enter a name for this status.');
$GLOBALS['TL_LANG']['tl_iso_orderstatus']['paid'] = array('Order is paid', 'Assume the order is paid when it has this status. This will for example allow files to be downloaded.');
+$GLOBALS['TL_LANG']['tl_iso_orderstatus']['welcomescreen'] = array('Show on welcome screen', 'Show number of orders with this status on the backend welcome screen.');
$GLOBALS['TL_LANG']['tl_iso_orderstatus']['mail_customer'] = array('E-Mail to customer', 'Select an email template to notify the customer when this status is assigned to an order.');
$GLOBALS['TL_LANG']['tl_iso_orderstatus']['mail_admin'] = array('E-Mail to admin', 'Select an email template to notify the admin when this status is assigned to an order.');

0 comments on commit 48b37fc

Please sign in to comment.