Migrate to Paheko 1.3
This commit is contained in:
parent
161659acfb
commit
235f8ceeed
31 changed files with 95 additions and 94 deletions
|
|
@ -14,7 +14,7 @@ $session->requireAccess($session::SECTION_ACCOUNTING, $session::ACCESS_WRITE);
|
|||
|
||||
use Paheko\DB;
|
||||
use stdClass;
|
||||
use const \Garradin\Plugin\Facturation\PATTERNS_LIST;
|
||||
use const \Paheko\Plugin\Facturation\PATTERNS_LIST;
|
||||
|
||||
$db = DB::getInstance();
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ $tpl->assign('natures_don', array('1' => 'Numéraire',
|
|||
$tpl->assign('textes_don', $facture->listTextesCerfa());
|
||||
|
||||
if ( !$target ) {
|
||||
qv(['id' => 'required|numeric']);
|
||||
f(['id' => 'required|numeric']);
|
||||
$id = (int) qg('id');
|
||||
|
||||
if (!$f = $facture->get($id))
|
||||
|
|
@ -200,13 +200,13 @@ elseif (isset($data))
|
|||
if ($target)
|
||||
{
|
||||
$id = $facture->add($data, $plugin->getConfig('pattern'));
|
||||
Utils::redirect(PLUGIN_URL . 'facture.php?id='.(int)$id);
|
||||
Utils::redirect(PLUGIN_ADMIN_URL . 'facture.php?id='.(int)$id);
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($facture->edit($id, $data))
|
||||
{
|
||||
Utils::redirect(PLUGIN_URL . 'facture.php?id='.(int)$id);
|
||||
Utils::redirect(PLUGIN_ADMIN_URL . 'facture.php?id='.(int)$id);
|
||||
}
|
||||
throw new UserException('Erreur d\'édition du reçu');
|
||||
}
|
||||
|
|
@ -324,7 +324,7 @@ $tpl->assign('date', $date->format('d/m/Y'));
|
|||
|
||||
|
||||
$tpl->assign(compact('liste', 'radio', 'step', 'designations', 'prix', 'from_user', 'identite', 'csrf_key', 'doc'));
|
||||
$tpl->assign('membres', $db->getAssoc('SELECT id, '.$identite.' FROM membres WHERE id_category != -2 NOT IN (SELECT id FROM users_categories WHERE hidden = 1);'));
|
||||
$tpl->assign('users', $db->getAssoc('SELECT id, '.$identite.' FROM users WHERE id_category != -2 NOT IN (SELECT id FROM users_categories WHERE hidden = 1);'));
|
||||
$tpl->assign('clients', $db->getAssoc('SELECT id, nom FROM plugin_facturation_clients;'));
|
||||
$tpl->assign('require_number', $require_number);
|
||||
$tpl->assign('number_pattern', PATTERNS_LIST[$plugin->getConfig('pattern')]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue