33require
'../../main.inc.php';
34require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
35require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
47$langs->loadLangs(array(
'banks',
'categories'));
51$action =
GETPOST(
'action',
'aZ09');
52$optioncss =
GETPOST(
'optioncss',
'aZ');
62if (!$user->hasRight(
'banque',
'configurer')) {
75 $bankcateg->label =
GETPOST(
'label');
76 $bankcateg->create($user);
83 if ($bankcateg->fetch($categid) > 0) {
85 if (
GETPOST(
'update') && $label) {
86 $bankcateg->label = $label;
87 $bankcateg->update($user);
90 if ($action ==
'delete' && $user->hasRight(
'banque',
'configurer')) {
91 $bankcateg->delete($user);
101$title = $langs->trans(
'RubriquesTransactions');
102$help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
107print
load_fiche_titre($langs->trans(
"RubriquesTransactions"),
'',
'object_category');
109print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
110if ($optioncss !=
'') {
111 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
113print
'<input type="hidden" name="token" value="'.newToken().
'">';
114print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
115print
'<input type="hidden" name="action" value="list">';
122print
'<div class="div-table-responsive">';
123print
'<table class="noborder centpercent">';
124print
'<tr class="liste_titre">';
125print
'<td>'.$langs->trans(
"Ref").
'</td><td>'.$langs->trans(
"Label").
'</td>';
131if ($action !=
'edit') {
132 print
'<tr class="oddeven">';
133 print
'<td> </td><td><input name="label" type="text" class="maxwidth100"></td>';
135 print
'<td class="center"><input type="submit" name="add" class="button button-add small" value="'.$langs->trans(
"Add").
'"></td>';
140include_once DOL_DOCUMENT_ROOT .
'/categories/class/categorie.class.php';
142$catTypeID = $cats->getMapId()[Categorie::TYPE_BANK_LINE];
144$sql =
"SELECT rowid, label";
145$sql .=
" FROM ".MAIN_DB_PREFIX.
"categorie";
146$sql .=
" WHERE entity = ".$conf->entity.
" AND type = " . ((int) $catTypeID);
147$sql .=
" ORDER BY rowid";
149$result = $db->query($sql);
151 $num = $db->num_rows($result);
156 $objp = $db->fetch_object($result);
158 print
'<tr class="oddeven">';
159 print
'<td>'.$objp->rowid.
'</td>';
160 if (
GETPOST(
'action',
'aZ09') ==
'edit' &&
GETPOST(
"categid") == $objp->rowid) {
161 print
'<td colspan="3">';
162 print
'<input type="hidden" name="categid" value="'.$objp->rowid.
'">';
163 print
'<input name="label" type="text" size=45 value="'.$objp->label.
'">';
164 print
'<input type="submit" name="update" class="button" value="'.$langs->trans(
"Edit").
'">';
167 print
"<td>".$objp->label.
"</td>";
171 print
'<td class="center">';
172 print
'<a class="editfielda reposition marginleftonly marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?categid='.$objp->rowid.
'&action=edit&token='.
newToken().
'">'.
img_edit().
'</a>';
173 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.