noalyss Version-9
category_card.inc.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21// Copyright Author Dany De Bontridder danydb@aevalys.eu
22
23/*!\file
24 * \brief this file will handle all the actions for a specific customer (
25 * contact,operation,invoice and financial)
26 * include from client.inc.php and concerned only the customer card and
27 * the customer category
28 */
29if (!defined('ALLOWED'))
30 die('Appel direct ne sont pas permis');
32global $http;
33
35
36$root="do.php?".http_build_query(["ac"=>$http->request("ac"),"sb"=>"detail","f_id"=>$http->request("f_id","number")]);
37$root.="&".$str_dossier;
38
39$ss_action=$http->request("sc", "string", "dc");
40
41switch ($ss_action)
42{
43 case 'dc':
44 $def=1;
45 break;
46 case 'sv': /* all the actions (mail,meeting...) */
47 $def=2;
48 break;
49 case 'cn':
50 $def=3;
51 break;
52 case 'op':
53 $def=4;
54 break;
55 case 'let':
56 $def=7;
57 break;
58 case 'bal':
59 $def=5;
60 break;
61 case 'balag':
62 $def=6;
63 break;
64 default:
65 $def=1;
66 $ss_action='dc';
67}
68$f_id=$http->request('f_id',"number");
70
71echo '<div class="content">';
72echo $f->get_gestion_title();
73
74$from=$http->request("ac");
75
76
77$menu[]= array('href'=>$root."&sc=dc", 'label'=>_('Fiche'), 'alt'=>_('Détail de la fiche'));
78$menu[]=array('href'=>$root.'&sc=sv', 'label'=>_('Suivi'), 'alt'=>_('Suivi Fournisseur, client, banque, devis, bon de commande, courrier'));
79// No submenu CONTACT for the menu CONTACT
80if ( strpos($from,"CONTACT") === false) {
81 $menu[]=array('href'=>$root.'&sc=cn', 'label'=>_('Contact'), 'alt'=>_('Liste de contacts'));
82}
83$menu[]=array('href'=>$root.'&sc=op', 'label'=>_('Opérations'), 'alt'=>_('Toutes les opérations'));
84$menu[]=array('href'=>$root.'&sc=bal', 'label'=>_('Balance'), 'alt'=>_('Balance du tiers'));
85$menu[]=array('href'=>$root.'&sc=balag', 'label'=>_('Balance âgée'), 'alt'=>_('Balance âgée du tiers'));
86$menu[]=array('href'=>$root.'&sc=let', 'label'=>_('Lettrage'), 'alt'=>_('Opérations & Lettrages'));
87
88echo '<ul class="tabs noprint" style="padding-top:0px">';
89for ($i=0; $i<count($menu); $i++)
90{
91 $style=($def==($i+1))?"tabs_selected":"tabs";
92 echo '<li class="'.$style.'">';
93 echo '<a href="'.$menu[$i]['href'].'" title="'.$menu[$i]['alt'].'">';
94 echo h($menu[$i]['label']);
95 echo '</a>';
96 echo '</li>';
97}
98echo '</ul>';
99echo '</div>';
100echo '<div>';
101echo '<div style="clear:both"></div>';
102echo '<div class="myfieldset">';
103//---------------------------------------------------------------------------
104// Show Detail of a card and category
105//---------------------------------------------------------------------------
106if ($ss_action=='dc')
107{
108 require_once NOALYSS_INCLUDE.'/category_detail.inc.php';
109}
110//---------------------------------------------------------------------------
111// Follow up : mail, bons de commande, livraison, rendez-vous...
112//---------------------------------------------------------------------------
113if ($ss_action=='sv')
114{
115 require_once NOALYSS_INCLUDE.'/category_followup.inc.php';
116}
117/* ----------------------------------------------------------------------
118 * Operation all the operation of this customer
119 *
120 * ---------------------------------------------------------------------- */
121if ($ss_action=='op')
122{
123 require_once NOALYSS_INCLUDE.'/category_operation.inc.php';
124}
125/* -------------------------------------------------------------------------
126 * Balance of the card
127 * ------------------------------------------------------------------------- */
128if ($ss_action=='bal')
129{
130 require_once NOALYSS_INCLUDE.'/balance_card.inc.php';
131}
132/* -------------------------------------------------------------------------
133 * Ageing Balance of the card
134 * ------------------------------------------------------------------------- */
135if ($ss_action=='balag')
136{
137 require_once NOALYSS_INCLUDE.'/balance_card_ageing.inc.php';
138}
139/* ----------------------------------------------------------------------
140 * All the contact
141 *
142 * ---------------------------------------------------------------------- */
143if ($ss_action=='cn')
144{
145 echo '<div class="content">';
146
147 echo dossier::hidden();
148 $f=new Fiche($cn, $http->request('f_id','number'));
149 $contact=new Contact($cn);
150 $contact->filter_company($f->get_quick_code());
151 echo $contact->summary();
152
153 $sql=' select fd_id from fiche_def where frd_id='.FICHE_TYPE_CONTACT;
154 $filter=$cn->make_list($sql);
155 if (empty($filter))
156 {
157 echo '<span class="notice">';
158 $url="do.php?".http_build_query(array('gDossier'=>Dossier::id(), 'ac'=>'CCARD'));
159 echo '<a class="line" href="'.$url.'" targer="_blank">';
160 echo _("Vous devez aller dans fiche et créer une catégorie pour les contacts");
161 echo '</a>';
162 echo '</span>';
163 return;
164 }
165 /* Add button */
166 $f_add_button=new IButton('add_card');
167 $f_add_button->label=_('Créer une nouvelle fiche');
168
169 $f_add_button->set_attribute('filter', $filter);
170 $f_add_button->javascript=" select_card_type(this);";
171
172 echo $f_add_button->input();
173 echo '</div>';
174}
175/* ----------------------------------------------------------------------------
176 * Lettering
177 * ---------------------------------------------------------------------------- */
178if ($def==7)
179{
180 require_once NOALYSS_INCLUDE.'/lettering.gestion.inc.php';
181}
182echo '</div>';
h( $row[ 'oa_description'])
$url
$filter
$str_dossier
global $http
switch($ss_action) $f_id
static get()
return a string to put to gDossier into a GET
static id()
return the 'gDossier' value after a check
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: fiche.class.php:38
Html Input.
static echo_file($msg, $print=true)
display the file
Definition: dbg.php:88
$def
show a form for quick_writing