noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
manager.inc.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
20/*!\brief include from supplier.inc.php and concerned only the supplier card and
21 * the supplier category
22 */
23if (!defined('ALLOWED'))
24 die('Appel direct ne sont pas permis');
25
27
28$low_action = (isset($_REQUEST['sb'])) ? $_REQUEST['sb'] : "list";
29/*! \file
30 * \brief Called from the module "Gestion" to manage the supplier
31 */
32$href = basename($_SERVER['PHP_SELF']);
33
34// by default open liste
35if ($low_action == "")
36 $low_action = "list";
37
38
39//-----------------------------------------------------
40// Remove a card
41//-----------------------------------------------------
42if (isset($_POST['action_fiche']))
43{
44 if ( $_POST['action_fiche'] == 'delete_card')
45 {
46 if ($g_user->check_action(FICADD) == 0)
47 {
48 alert(_('Vous ne pouvez pas enlever de fiche'));
49 return;
50 }
51
52 $f_id = $http->request('f_id','number');
53
54 $fiche = new Manager($cn, $f_id);
55 $fiche->remove();
56 $low_action = "list";
57 }
58}
59
60//-----------------------------------------------------
61// list of Manager / employeed
62//-----------------------------------------------------
63if ($low_action == "list")
64{
65 ?>
66 <div class="content">
67 <div>
68 <?php
69 Manager::form_search($href, FICHE_TYPE_EMPL);
70 ?>
71 </div>
72 <?php
73 $supplier = new Manager($cn);
74 $search=$http->get("query","string","");
75 $sql = "";
76 if (isset($_GET['cat']))
77 {
78 $cat=$http->get("cat","number");
79 if ($cat!= -1 ) $sql = sprintf(" and fd_id = %s", $cat);
80 }
81 $noop = (isset($_GET['noop'])) ? false : true;
82
83 echo '<div class="content">';
84 echo $supplier->Summary($search, 'manager', $sql, $noop);
85
86
87 echo '<br>';
88 echo '<br>';
89 echo '<br>';
90 if ($g_user->check_action(FICADD) == 1)
91 {
92 /* Add button */
93 $f_add_button = new IButton('add_card');
94 $f_add_button->label = _('Créer une nouvelle fiche');
95 $f_add_button->set_attribute('win_refresh', 'yes');
96
97 $f_add_button->set_attribute('type_cat', FICHE_TYPE_EMPL);
98 $f_add_button->javascript = " select_card_type(this);";
99 echo $f_add_button->input();
100
101 $f_cat_button = new IButton('add_cat');
102 $f_cat_button->set_attribute('type_cat', FICHE_TYPE_EMPL);
103 $f_cat_button->set_attribute('ipopup', 'ipop_cat');
104 $f_cat_button->label = _('Ajout d\'une catégorie');
105 $f_cat_button->javascript = 'add_category(this)';
106 echo $f_cat_button->input();
107 }
108
109 echo '</div>';
110 echo '</div>';
111}
112/* ----------------------------------------------------------------------
113 * Detail for a card, Suivi, Contact, Operation,... *
114 * cc stands for supplier card
115 * ---------------------------------------------------------------------- */
116if ($low_action == 'detail')
117{
118 /* Menu */
119 require_once NOALYSS_INCLUDE.'/category_card.inc.php';
120 return;
121}
122
123
124
126?>
html_page_stop()
end tag
alert($p_msg, $buffer=false)
alert in javascript
global $g_user
if no group available , then stop
$low_action
Definition adm.inc.php:27
$href
Definition adm.inc.php:31
$_REQUEST['ac']
if(trim($query)==''|| $filter=='') $search
_("actif, passif,charge,...")
$_GET['qcode']
Html Input.
class Supplier are a specific kind of card
const FICHE_TYPE_EMPL
Definition constant.php:264
const FICADD
$_POST['ac']
Definition do.php:323