[*] BO : #PSFV-94 - added AdminSlipController

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@9730 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
tDidierjean
2011-10-28 16:07:40 +00:00
parent 4e04df6d98
commit b230e4654d
5 changed files with 80 additions and 19 deletions
@@ -0,0 +1,48 @@
{*
* 2007-2011 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
* @author PrestaShop SA <contact@prestashop.com>
* @copyright 2007-2011 PrestaShop SA
* @version Release: $Revision$
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
* International Registered Trademark & Property of PrestaShop SA
*}
{$content}
<h2>{l s='Print PDF'}</h2>
<fieldset style="float:left;width:300px;margin-bottom:20px"><legend><img src="../img/admin/pdf.gif" alt="" /> {l s='By date'}</legend>
<form action="{$url_post}" method="post">
<label style="width:90px">{l s='From:'} </label>
<div class="margin-form" style="padding-left:100px">
<input type="text" size="4" maxlength="10" name="date_from" value="{$date}" style="width: 120px;" /> <sup>*</sup>
<p class="clear">{l s='Format: 2007-12-31 (inclusive)'}</p>
</div>
<label style="width:90px">{l s='To:'} </label>
<div class="margin-form" style="padding-left:100px">
<input type="text" size="4" maxlength="10" name="date_to" value="{$date}" style="width: 120px;" /> <sup>*</sup>
<p class="clear">{l s='Format: 2008-12-31 (inclusive)'}</p>
</div>
<div class="margin-form" style="padding-left:100px">
<input type="submit" value="{l s='Generate PDF file'}" name="submitPrint" class="button" />
</div>
</form>
</fieldset>
+5 -1
View File
@@ -96,6 +96,9 @@ class AdminControllerCore extends Controller
/** @var integer Number of results in list */ /** @var integer Number of results in list */
protected $_listTotal = 0; protected $_listTotal = 0;
/** @var boolean Automatically join language table if true */
public $lang = false;
/** @var array WHERE clause determined by filter fields */ /** @var array WHERE clause determined by filter fields */
protected $_filter; protected $_filter;
@@ -1084,7 +1087,8 @@ class AdminControllerCore extends Controller
'table' => $this->table, 'table' => $this->table,
'current' => self::$currentIndex, 'current' => self::$currentIndex,
'token' => $this->token, 'token' => $this->token,
'content' => $this->content 'content' => $this->content,
'url_post' => self::$currentIndex.'&token='.$this->token,
)); ));
} }
@@ -67,7 +67,6 @@ class AdminInvoicesControllerCore extends AdminController
$statusStats[$row['id_order_state']] = $row['nbOrders']; $statusStats[$row['id_order_state']] = $row['nbOrders'];
$this->context->smarty->assign(array( $this->context->smarty->assign(array(
'url_post' => self::$currentIndex.'&token='.$this->token,
'date' => date('Y-m-d'), 'date' => date('Y-m-d'),
'statuses' => $statuses, 'statuses' => $statuses,
'statusStats' => $statusStats 'statusStats' => $statusStats
@@ -194,7 +194,7 @@ class AdminShippingControllerCore extends AdminController
$this->_errors[] = Tools::displayError('You do not have permission to edit here.'); $this->_errors[] = Tools::displayError('You do not have permission to edit here.');
} }
else else
parent::postProcess(); return parent::postProcess();
} }
} }
@@ -25,15 +25,16 @@
* International Registered Trademark & Property of PrestaShop SA * International Registered Trademark & Property of PrestaShop SA
*/ */
class AdminSlip extends AdminTab class AdminSlipControllerCore extends AdminController
{ {
public function __construct() public function __construct()
{ {
$this->table = 'order_slip'; $this->table = 'order_slip';
$this->className = 'OrderSlip'; $this->className = 'OrderSlip';
$this->edit = true; $this->addRowAction('edit');
$this->delete = true; $this->addRowAction('delete');
$this->noAdd = true; $this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
$this->no_add = true;
$this->fieldsDisplay = array( $this->fieldsDisplay = array(
'id_order_slip' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25), 'id_order_slip' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
@@ -64,7 +65,16 @@ class AdminSlip extends AdminTab
return parent::postProcess(); return parent::postProcess();
} }
public function display() public function initContent()
{
$this->context->smarty->assign(array(
'date' => date('Y-m-d'),
));
parent::initContent();
}
/* public function display()
{ {
echo '<div style="float:left;width:600px">'; echo '<div style="float:left;width:600px">';
$this->getList($this->context->language->id, !Tools::getValue($this->table.'Orderby') ? 'date_add' : NULL, !Tools::getValue($this->table.'Orderway') ? 'DESC' : NULL); $this->getList($this->context->language->id, !Tools::getValue($this->table.'Orderby') ? 'date_add' : NULL, !Tools::getValue($this->table.'Orderway') ? 'DESC' : NULL);
@@ -90,8 +100,8 @@ class AdminSlip extends AdminTab
</form> </form>
</fieldset><div class="clear">&nbsp;</div>'; </fieldset><div class="clear">&nbsp;</div>';
} }
*/
public function displayListContent($token = NULL) /* public function displayListContent($token = NULL)
{ {
$irow = 0; $irow = 0;
if ($this->_list) if ($this->_list)
@@ -112,6 +122,6 @@ class AdminSlip extends AdminTab
echo '</td>'; echo '</td>';
echo '</tr>'; echo '</tr>';
} }
} }*/
} }