Go to the documentation of this file.
29 require
'../../main.inc.php';
30 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/account.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/compta/bank/class/bankcateg.class.php';
34 $langs->loadLangs(array(
'banks',
'categories'));
36 $action =
GETPOST(
'action',
'aZ09');
37 $optioncss =
GETPOST(
'optioncss',
'aZ');
39 if (!$user->rights->banque->configurer) {
56 $bankcateg->label =
GETPOST(
'label');
57 $bankcateg->create($user);
64 if ($bankcateg->fetch($categid) > 0) {
66 if (
GETPOST(
'update') && $label) {
67 $bankcateg->label = $label;
68 $bankcateg->update($user);
71 if ($action ==
'delete') {
72 $bankcateg->delete($user);
82 $title = $langs->trans(
'RubriquesTransactions');
83 $help_url =
'EN:Module_Banks_and_Cash|FR:Module_Banques_et_Caisses|ES:Módulo_Bancos_y_Cajas';
88 print
load_fiche_titre($langs->trans(
"RubriquesTransactions"),
'',
'object_category');
90 print
'<form method="POST" action="'.$_SERVER[
"PHP_SELF"].
'">';
91 if ($optioncss !=
'') {
92 print
'<input type="hidden" name="optioncss" value="'.$optioncss.
'">';
94 print
'<input type="hidden" name="token" value="'.newToken().
'">';
95 print
'<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
96 print
'<input type="hidden" name="action" value="list">';
103 print
'<div class="div-table-responsive">';
104 print
'<table class="noborder centpercent">';
105 print
'<tr class="liste_titre">';
106 print
'<td>'.$langs->trans(
"Ref").
'</td><td>'.$langs->trans(
"Label").
'</td>';
112 if ($action !=
'edit') {
113 print
'<tr class="oddeven">';
114 print
'<td> </td><td><input name="label" type="text" class="maxwidth100"></td>';
116 print
'<td class="center"><input type="submit" name="add" class="button button-add small" value="'.$langs->trans(
"Add").
'"></td>';
121 $sql =
"SELECT rowid, label";
122 $sql .=
" FROM ".MAIN_DB_PREFIX.
"bank_categ";
123 $sql .=
" WHERE entity = ".$conf->entity;
124 $sql .=
" ORDER BY rowid";
126 $result = $db->query($sql);
128 $num = $db->num_rows($result);
133 $objp = $db->fetch_object($result);
135 print
'<tr class="oddeven">';
136 print
'<td>'.$objp->rowid.
'</td>';
137 if (
GETPOST(
'action',
'aZ09') ==
'edit' &&
GETPOST(
"categid") == $objp->rowid) {
138 print
'<td colspan="3">';
139 print
'<input type="hidden" name="categid" value="'.$objp->rowid.
'">';
140 print
'<input name="label" type="text" size=45 value="'.$objp->label.
'">';
141 print
'<input type="submit" name="update" class="button" value="'.$langs->trans(
"Edit").
'">';
144 print
"<td>".$objp->label.
"</td>";
148 print
'<td class="center">';
149 print
'<a class="editfielda reposition marginleftonly marginrightonly" href="'.$_SERVER[
"PHP_SELF"].
'?categid='.$objp->rowid.
'&action=edit&token='.
newToken().
'">'.
img_edit().
'</a>';
150 print
'<a class="marginleftonly" href="'.$_SERVER[
"PHP_SELF"].
'?categid='.$objp->rowid.
'&action=delete&token='.
newToken().
'">'.
img_delete().
'</a>';
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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 editer/modifier fiche.
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
img_delete($titlealt='default', $other='class="pictodelete"', $morecss='')
Show delete logo.
Class to manage bank categories.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.