31require
'../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
37$langs->loadLangs(array(
'banks',
'categories'));
41$action =
GETPOST(
'action',
'aZ09');
42$optioncss =
GETPOST(
'optioncss',
'aZ');
52if (!$user->hasRight(
'banque',
'configurer')) {
65 $bankcateg->label =
GETPOST(
'label');
66 $bankcateg->create($user);
73 if ($bankcateg->fetch($categid) > 0) {
75 if (
GETPOST(
'update') && $label) {
76 $bankcateg->label = $label;
77 $bankcateg->update($user);
80 if ($action ==
'delete' && $user->hasRight(
'banque',
'configurer')) {
81 $bankcateg->delete($user);
91$title = $langs->trans(
'RubriquesTransactions');
92$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
97print
load_fiche_titre($langs->trans(
"RubriquesTransactions"),
'',
'object_category');
99print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
100if ($optioncss !=
'') {
101 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
103print
'<input type="hidden" name="token" value="'.newToken().
'">';
104print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
105print
'<input type="hidden" name="action" value="list">';
112print
'<div class="div-table-responsive">';
113print
'<table class="noborder centpercent">';
114print
'<tr class="liste_titre">';
115print
'<td>'.$langs->trans(
"Ref").
'</td><td>'.$langs->trans(
"Label").
'</td>';
121if ($action !=
'edit') {
122 print
'<tr class="oddeven">';
123 print
'<td> </td><td><input name="label" type="text" class="maxwidth100"></td>';
125 print
'<td class="center"><input type="submit" name="add" class="button button-add small" value="'.$langs->trans(
"Add").
'"></td>';
130$sql =
"SELECT rowid, label";
131$sql .=
" FROM ".MAIN_DB_PREFIX.
"category_bank";
132$sql .=
" WHERE entity = ".$conf->entity;
133$sql .=
" ORDER BY rowid";
135$result = $db->query($sql);
137 $num = $db->num_rows($result);
142 $objp = $db->fetch_object($result);
144 print
'<tr class="oddeven">';
145 print
'<td>'.$objp->rowid.
'</td>';
146 if (
GETPOST(
'action',
'aZ09') ==
'edit' &&
GETPOST(
"categid") == $objp->rowid) {
147 print
'<td colspan="3">';
148 print
'<input type="hidden" name="categid" value="'.$objp->rowid.
'">';
149 print
'<input name="label" type="text" size=45 value="'.$objp->label.
'">';
150 print
'<input type="submit" name="update" class="button" value="'.$langs->trans(
"Edit").
'">';
153 print
"<td>".$objp->label.
"</td>";
157 print
'<td class="center">';
158 print
'<a class="editfielda reposition marginleftonly marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?categid='.$objp->rowid.
'&action=edit&token='.
newToken().
'">'.
img_edit().
'</a>';
159 print
'<a class="marginleftonly" href="'.$_SERVER[
"PHP_SELF"].
'?categid='.$objp->rowid.
'&action=delete&token='.
newToken().
'">'.
img_delete().
'</a>';
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage bank categories.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.