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