noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
bookmark.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19// Copyright Author Dany De Bontridder danydb@aevalys.eu 18/08/24
20/*!
21 * \file
22 * \brief bookmark widget
23 */
24namespace Noalyss\Widget;
25
26class Bookmark extends Widget
27{
28 function display()
29 {
30 global $g_user;
31 $this->open_div();
32
33
34 $this->title(_("Favoris") . '&#x2728;');
35 $bookmark_sql="select distinct b_id,b_action,b_order,me_code,me_description, javascript"
36 . " from bookmark "
37 . "join v_menu_description_favori on (code=b_action or b_action=me_code)"
38 . "where "
39 . "login=$1 order by me_code";
40 $a_bookmark=$this->db->get_array($bookmark_sql,array($g_user->login));
41
42 $dossier_id=\Dossier::id();
43 if (count($a_bookmark) >0 ) {
44 $p=0;
45 foreach ($a_bookmark as $item) {
46 $a_code= explode('/',$item['b_action']);
47 $idx=count($a_code);
48 $code=$a_code[$idx-1];
49 $url=http_build_query(array("ac"=>$item['b_action'],"gDossier"=>$dossier_id));
50 $p++;
51 $class=($p&1)?' odd ':'even';
52 $description=h($item['me_description']);
53 echo <<<EOF
54<div class="row {$class} hover">
55 <div class="col-3">
56
57
58 <a class="line" href="do.php?{$url}">{$code} </a>
59 </div>
60 <div class="col-7">
61
62
63 <a class="mtitle" href="do.php?{$url}">{$description}</a>
64 </div>
65</div>
66EOF;
67
68 }
69 }
70 $this->close_div();
71
72 }
73
74}
global $g_user
if no group available , then stop
$dossier_id
h( $row[ 'oa_description'])
if(! isset($_GET['ac'])) if(isset( $_GET[ 'bookmark_add'])) if(isset($_GET['bookmark_delete']) &&isset($_GET['book'])) $bookmark_sql
$a_bookmark
_("actif, passif,charge,...")
$p
Definition calendar.php:9
display()
display the content for the current connected user of the widget with the parameter
Definition bookmark.php:28
Main class for widget.
Definition widget.php:32
open_div()
output the DIV HTML with class and id for the widget
Definition widget.php:157
$anc_filter title
$SecUser db