32require
'../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/treeview.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
45$langs->loadLangs(array(
"main",
"categories",
"takepos",
"printing"));
49$action =
GETPOST(
'action',
'aZ09');
50$printer1 =
GETPOST(
'printer1',
'alpha');
51$printer2 =
GETPOST(
'printer2',
'alpha');
52$printer3 =
GETPOST(
'printer3',
'alpha');
56if (is_numeric($type)) {
57 $type = array_search($type, $categstatic->MAP_ID);
70if ($action ==
"SavePrinter1") {
71 $printedcategories =
";";
72 if (is_array($printer1)) {
73 foreach ($printer1 as $cat) {
74 $printedcategories = $printedcategories.$cat.
";";
80if ($action ==
"SavePrinter2") {
81 $printedcategories =
";";
82 if (is_array($printer2)) {
83 foreach ($printer2 as $cat) {
84 $printedcategories = $printedcategories.$cat.
";";
90if ($action ==
"SavePrinter3") {
91 $printedcategories =
";";
92 if (is_array($printer3)) {
93 foreach ($printer3 as $cat) {
94 $printedcategories = $printedcategories.$cat.
";";
106$form =
new Form($db);
108$title = $langs->trans(
"Categories");
109$title .=
' ('.$langs->trans(empty(Categorie::$MAP_TYPE_TITLE_AREA[$type]) ? ucfirst($type) :
Categorie::$MAP_TYPE_TITLE_AREA[$type]).
')';
112 '/public/includes/jquery/plugins/jquerytreeview/jquery.treeview.js',
113 '/public/includes/jquery/plugins/jquerytreeview/lib/jquery.cookie.js',
115$arrayofcss = array(
'/public/includes/jquery/plugins/jquerytreeview/jquery.treeview.css');
117llxHeader(
'', $title,
'',
'', 0, 0, $arrayofjs, $arrayofcss,
'',
'mod-takepos page-admin_orderprinters');
124print
'<div class="fichecenter"><div class="fichethirdleft">';
126print
'</div><div class="fichetwothirdright">';
131print
'<div class="fichecenter"><br>';
135$cate_arbo = $categstatic->get_full_arbo($type);
138$fulltree = $cate_arbo;
142$data[] = array(
'rowid' => 0,
'fk_menu' => -1,
'title' =>
"racine",
'mainmenu' =>
'',
'leftmenu' =>
'',
'fk_mainmenu' =>
'',
'fk_leftmenu' =>
'');
143foreach ($fulltree as $key => $val) {
144 $categstatic->id = $val[
'id'];
145 $categstatic->ref = $val[
'label'];
146 $categstatic->color = $val[
'color'];
147 $categstatic->type = $type;
149 $li = $categstatic->getNomUrl(1,
'', 60);
154 'rowid' => $val[
'rowid'],
155 'fk_menu' => empty($val[
'fk_menu']) ? 0 : $val[
'fk_menu'],
156 'fk_parent' => $val[
'fk_parent'],
157 'label' => $val[
'label']
162print
'<table class="liste nohover" width="100%">';
163print
'<tr class="liste_titre"><td>'.$langs->trans(
"Printer").
' 1</td><td></td><td class="right">';
165$nbofentries = (count($data) - 1);
166print
'<form action="orderprinters.php">';
167print
'<input type="hidden" name="token" value="'.newToken().
'">';
168if ($nbofentries > 0) {
169 print
'<tr class="pair"><td colspan="3">';
170 print
'<input type="hidden" name="action" value="SavePrinter1">';
171 foreach ($data as $row) {
172 if (strpos(
getDolGlobalString(
'TAKEPOS_PRINTED_CATEGORIES_1'),
';'.$row[
"rowid"].
';') !==
false) {
173 $checked =
'checked';
177 if ($row[
"fk_menu"] >= 0) {
178 print
'<input type="checkbox" name="printer1[]" value="'.$row[
"rowid"].
'" '.$checked.
'>'.$row[
"label"].
'<br>';
183 print
'<tr class="pair">';
184 print
'<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
185 print
'<td valign="middle">';
186 print $langs->trans(
"NoCategoryYet");
188 print
'<td> </td>';
189 print
'</table></td>';
193print
'<input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'"></form>';
197print
'<table class="liste nohover" width="100%">';
198print
'<tr class="liste_titre"><td>'.$langs->trans(
"Printer").
' 2</td><td></td><td class="right">';
200$nbofentries = (count($data) - 1);
201print
'<form action="orderprinters.php">';
202print
'<input type="hidden" name="token" value="'.newToken().
'">';
203if ($nbofentries > 0) {
204 print
'<tr class="pair"><td colspan="3">';
205 print
'<input type="hidden" name="action" value="SavePrinter2">';
206 foreach ($data as $row) {
207 if (strpos(
getDolGlobalString(
'TAKEPOS_PRINTED_CATEGORIES_2'),
';'.$row[
"rowid"].
';') !==
false) {
208 $checked =
'checked';
212 if ($row[
"fk_menu"] >= 0) {
213 print
'<input type="checkbox" name="printer2[]" value="'.$row[
"rowid"].
'" '.$checked.
'>'.$row[
"label"].
'<br>';
218 print
'<tr class="pair">';
219 print
'<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
220 print
'<td valign="middle">';
221 print $langs->trans(
"NoCategoryYet");
223 print
'<td> </td>';
224 print
'</table></td>';
228print
'<input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'"></form>';
232print
'<table class="liste nohover" width="100%">';
233print
'<tr class="liste_titre"><td>'.$langs->trans(
"Printer").
' 3</td><td></td><td class="right">';
235$nbofentries = (count($data) - 1);
236print
'<form action="orderprinters.php">';
237print
'<input type="hidden" name="token" value="'.newToken().
'">';
238if ($nbofentries > 0) {
239 print
'<tr class="pair"><td colspan="3">';
240 print
'<input type="hidden" name="action" value="SavePrinter3">';
241 foreach ($data as $row) {
242 if (strpos(
getDolGlobalString(
'TAKEPOS_PRINTED_CATEGORIES_3'),
';'.$row[
"rowid"].
';') !==
false) {
243 $checked =
'checked';
247 if ($row[
"fk_menu"] >= 0) {
248 print
'<input type="checkbox" name="printer3[]" value="'.$row[
"rowid"].
'" '.$checked.
'>'.$row[
"label"].
'<br>';
253 print
'<tr class="pair">';
254 print
'<td colspan="3"><table class="nobordernopadding"><tr class="nobordernopadding"><td>'.img_picto_common(
'',
'treemenu/branchbottom.gif').
'</td>';
255 print
'<td valign="middle">';
256 print $langs->trans(
"NoCategoryYet");
258 print
'<td> </td>';
259 print
'</table></td>';
264print
'<input type="submit" class="button button-save" value="'.$langs->trans(
"Save").
'"></form>';
$id
Support class for third parties, contacts, members, users or resources.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 categories.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_htmlcleanlastbr($stringtodecode)
This function remove all ending and br at end.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.