[*] 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:
@@ -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>
|
||||
|
||||
|
||||
@@ -96,6 +96,9 @@ class AdminControllerCore extends Controller
|
||||
/** @var integer Number of results in list */
|
||||
protected $_listTotal = 0;
|
||||
|
||||
/** @var boolean Automatically join language table if true */
|
||||
public $lang = false;
|
||||
|
||||
/** @var array WHERE clause determined by filter fields */
|
||||
protected $_filter;
|
||||
|
||||
@@ -772,7 +775,7 @@ class AdminControllerCore extends Controller
|
||||
if (!$this->checkToken())
|
||||
{
|
||||
// If this is an XSS attempt, then we should only display a simple, secure page
|
||||
// ${1} in the replacement string of the regexp is required,
|
||||
// ${1} in the replacement string of the regexp is required,
|
||||
// because the token may begin with a number and mix up with it (e.g. $17)
|
||||
$url = preg_replace('/([&?]token=)[^&]*(&.*)?$/', '${1}'.$this->token.'$2', $_SERVER['REQUEST_URI']);
|
||||
if (false === strpos($url, '?token=') && false === strpos($url, '&token='))
|
||||
@@ -1084,13 +1087,14 @@ class AdminControllerCore extends Controller
|
||||
'table' => $this->table,
|
||||
'current' => self::$currentIndex,
|
||||
'token' => $this->token,
|
||||
'content' => $this->content
|
||||
'content' => $this->content,
|
||||
'url_post' => self::$currentIndex.'&token='.$this->token,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the invalid doom page of death
|
||||
*
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function initCursedPage()
|
||||
|
||||
@@ -67,7 +67,6 @@ class AdminInvoicesControllerCore extends AdminController
|
||||
$statusStats[$row['id_order_state']] = $row['nbOrders'];
|
||||
|
||||
$this->context->smarty->assign(array(
|
||||
'url_post' => self::$currentIndex.'&token='.$this->token,
|
||||
'date' => date('Y-m-d'),
|
||||
'statuses' => $statuses,
|
||||
'statusStats' => $statusStats
|
||||
|
||||
@@ -194,7 +194,7 @@ class AdminShippingControllerCore extends AdminController
|
||||
$this->_errors[] = Tools::displayError('You do not have permission to edit here.');
|
||||
}
|
||||
else
|
||||
parent::postProcess();
|
||||
return parent::postProcess();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2011 PrestaShop
|
||||
* 2007-2011 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
@@ -25,26 +25,27 @@
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
class AdminSlip extends AdminTab
|
||||
class AdminSlipControllerCore extends AdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->table = 'order_slip';
|
||||
$this->className = 'OrderSlip';
|
||||
$this->edit = true;
|
||||
$this->delete = true;
|
||||
$this->noAdd = true;
|
||||
|
||||
$this->addRowAction('edit');
|
||||
$this->addRowAction('delete');
|
||||
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
||||
$this->no_add = true;
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_order_slip' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'id_order' => array('title' => $this->l('ID Order'), 'width' => 75, 'align' => 'center'),
|
||||
'date_add' => array('title' => $this->l('Date issued'), 'width' => 60, 'type' => 'date', 'align' => 'right'));
|
||||
|
||||
|
||||
$this->optionTitle = $this->l('Slip');
|
||||
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
if (Tools::isSubmit('submitPrint'))
|
||||
@@ -64,13 +65,22 @@ class AdminSlip extends AdminTab
|
||||
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">';
|
||||
$this->getList($this->context->language->id, !Tools::getValue($this->table.'Orderby') ? 'date_add' : NULL, !Tools::getValue($this->table.'Orderway') ? 'DESC' : NULL);
|
||||
$this->displayList();
|
||||
echo '</div>';
|
||||
|
||||
|
||||
echo '
|
||||
<fieldset style="float:left;width:280px"><legend><img src="../img/admin/pdf.gif" alt="" /> '.$this->l('Print PDF').'</legend>
|
||||
<form action="'.self::$currentIndex.'&token='.$this->token.'" method="post">
|
||||
@@ -90,8 +100,8 @@ class AdminSlip extends AdminTab
|
||||
</form>
|
||||
</fieldset><div class="clear"> </div>';
|
||||
}
|
||||
|
||||
public function displayListContent($token = NULL)
|
||||
*/
|
||||
/* public function displayListContent($token = NULL)
|
||||
{
|
||||
$irow = 0;
|
||||
if ($this->_list)
|
||||
@@ -112,6 +122,6 @@ class AdminSlip extends AdminTab
|
||||
echo '</td>';
|
||||
echo '</tr>';
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user