32require
'../../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
38$langs->loadLangs(array(
'banks',
'categories'));
42$action =
GETPOST(
'action',
'aZ09');
43$optioncss =
GETPOST(
'optioncss',
'aZ');
53if (!$user->hasRight(
'banque',
'configurer')) {
66 $bankcateg->label =
GETPOST(
'label');
67 $bankcateg->create($user);
74 if ($bankcateg->fetch($categid) > 0) {
76 if (
GETPOST(
'update') && $label) {
77 $bankcateg->label = $label;
78 $bankcateg->update($user);
81 if ($action ==
'delete' && $user->hasRight(
'banque',
'configurer')) {
82 $bankcateg->delete($user);
92$title = $langs->trans(
'RubriquesTransactions');
93$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
98print
load_fiche_titre($langs->trans(
"RubriquesTransactions"),
'',
'object_category');
100print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
101if ($optioncss !=
'') {
102 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
104print
'<input type="hidden" name="token" value="'.newToken().
'">';
105print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
106print
'<input type="hidden" name="action" value="list">';
113print
'<div class="div-table-responsive">';
114print
'<table class="noborder centpercent">';
115print
'<tr class="liste_titre">';
116print
'<td>'.$langs->trans(
"Ref").
'</td><td>'.$langs->trans(
"Label").
'</td>';
122if ($action !=
'edit') {
123 print
'<tr class="oddeven">';
124 print
'<td> </td><td><input name="label" type="text" class="maxwidth100"></td>';
126 print
'<td class="center"><input type="submit" name="add" class="button button-add small" value="'.$langs->trans(
"Add").
'"></td>';
131include_once DOL_DOCUMENT_ROOT .
'/categories/class/categorie.class.php';
133$catTypeID = $cats->getMapId()[Categorie::TYPE_BANK_LINE];
135$sql =
"SELECT rowid, label";
136$sql .=
" FROM ".MAIN_DB_PREFIX.
"categorie";
137$sql .=
" WHERE entity = ".$conf->entity.
" AND type = " . ((int) $catTypeID);
138$sql .=
" ORDER BY rowid";
140$result = $db->query($sql);
142 $num = $db->num_rows($result);
147 $objp = $db->fetch_object($result);
149 print
'<tr class="oddeven">';
150 print
'<td>'.$objp->rowid.
'</td>';
151 if (
GETPOST(
'action',
'aZ09') ==
'edit' &&
GETPOST(
"categid") == $objp->rowid) {
152 print
'<td colspan="3">';
153 print
'<input type="hidden" name="categid" value="'.$objp->rowid.
'">';
154 print
'<input name="label" type="text" size=45 value="'.$objp->label.
'">';
155 print
'<input type="submit" name="update" class="button" value="'.$langs->trans(
"Edit").
'">';
158 print
"<td>".$objp->label.
"</td>";
162 print
'<td class="center">';
163 print
'<a class="editfielda reposition marginleftonly marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?categid='.$objp->rowid.
'&action=edit&token='.
newToken().
'">'.
img_edit().
'</a>';
164 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.
Class to manage 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.