noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
category_card.inc.php
Go to the documentation of this file.
00001 <?php
00002 /*
00003  *   This file is part of NOALYSS.
00004  *
00005  *   NOALYSS is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   NOALYSS is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with NOALYSS; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 
00020 // Copyright Author Dany De Bontridder danydb@aevalys.eu
00021 
00022 /*!\file
00023  * \brief this file will handle all the actions for a specific customer (
00024  * contact,operation,invoice and financial)
00025  * include from client.inc.php and concerned only the customer card and
00026  * the customer category
00027  */
00028 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
00029 require_once('class_contact.php');
00030 
00031 $str_dossier=Dossier::get();
00032 /* $sub_action = sb = detail */
00033 /* $cn database conx */
00034 $root='?ac='.$_REQUEST['ac']."&sb=detail&f_id=".$_REQUEST["f_id"].'&'.$str_dossier;
00035 $ss_action=( isset ($_REQUEST['sc'] ))? $_REQUEST['sc']: '';
00036 switch ($ss_action)
00037 {
00038 case 'dc':
00039     $def=1;
00040     break;
00041 case 'sv':                      /* all the actions (mail,meeting...) */
00042     $def=2;
00043     break;
00044 case 'cn':
00045     $def=3;
00046     break;
00047 case 'op':
00048     $def=4;
00049     break;
00050 case 'let':
00051     $def=6;
00052     break;
00053 case 'bal':
00054   $def=5;
00055   break;
00056 default:
00057     $def=1;
00058     $ss_action='dc';
00059 }
00060 $f=new Fiche($cn,$_REQUEST['f_id']);
00061 
00062 echo '<div class="content">';
00063 echo $f->get_gestion_title();
00064 $menu = array(
00065                   array('href'=>$root."&sc=dc",'label'=>_('Fiche'),'alt'=>_('Détail de la fiche')),
00066                   array('href'=>$root.'&sc=sv','label'=>_('Suivi'),'alt'=>_('Suivi Fournisseur, client, banque, devis, bon de commande, courrier')),
00067                   array('href'=>$root.'&sc=cn','label'=>_('Contact'),'alt'=>_('Liste de contacts')),
00068                   array('href'=>$root.'&sc=op','label'=>_('Opérations'),'alt'=>_('Toutes les opérations')),
00069                   array('href'=>$root.'&sc=bal','label'=>_('Balance'),'alt'=>_('Balance du fournisseur')),
00070                   array('href'=>$root.'&sc=let','label'=>_('Lettrage'),'alt'=>_('Opérations & Lettrages'))
00071                   );
00072 echo '<ul class="tabs">';
00073 for ($i=0;$i<count($menu);$i++) {
00074     $style=($def==($i+1))?"tabs_selected":"tabs";
00075     echo '<li class="'.$style.'">';
00076     echo '<a href="'.$menu[$i]['href'].'" alt="'.$menu[$i]['alt'].'">';
00077     echo h($menu[$i]['label']);
00078     echo '</a>';
00079     echo '</li>';
00080 }
00081 echo '</ul>';
00082 echo '</div>';
00083 echo '<div>';
00084 
00085 echo '<div class="myfieldset">';
00086 //---------------------------------------------------------------------------
00087 // Show Detail of a card and category
00088 //---------------------------------------------------------------------------
00089 if ( $ss_action == 'dc' )
00090 {
00091     require_once('category_detail.inc.php');
00092 }
00093 //---------------------------------------------------------------------------
00094 // Follow up : mail, bons de commande, livraison, rendez-vous...
00095 //---------------------------------------------------------------------------
00096 if ( $ss_action == 'sv' )
00097 {
00098     require_once('category_followup.inc.php');
00099 }
00100 /*----------------------------------------------------------------------
00101  * Operation all the operation of this customer
00102  *
00103  * ----------------------------------------------------------------------*/
00104 if ( $ss_action == 'op')
00105 {
00106     require_once('category_operation.inc.php');
00107 }
00108 /*-------------------------------------------------------------------------
00109  * Balance of the card
00110  *-------------------------------------------------------------------------*/
00111 if ( $ss_action=='bal')
00112   {
00113     require_once('balance_card.inc.php');
00114   }
00115 /*----------------------------------------------------------------------
00116  * All the contact
00117  *
00118  *----------------------------------------------------------------------*/
00119 if ( $ss_action == 'cn')
00120 {
00121     echo '<div class="content">';
00122 
00123         echo dossier::hidden();
00124         $f = new Fiche($cn, $_REQUEST['f_id']);
00125         $contact=new Contact($cn);
00126     $contact->company=$f->get_quick_code();
00127     echo $contact->summary("");
00128 
00129     $sql=' select fd_id from fiche_def where frd_id='.FICHE_TYPE_CONTACT;
00130     $filter=$cn->make_list($sql);
00131     if ( empty ($filter))
00132     {
00133         echo '<span class="notice">';
00134         echo _("Vous devez aller dans fiche et créer une catégorie pour les contacts");
00135         echo '</span>';
00136        return;
00137     }
00138     /* Add button */
00139     $f_add_button=new IButton('add_card');
00140     $f_add_button->label=_('Créer une nouvelle fiche');
00141 
00142     $f_add_button->set_attribute('filter',$filter);
00143     $f_add_button->javascript=" select_card_type(this);";
00144 
00145     echo $f_add_button->input();
00146     echo '</div>';
00147 }
00148 /*----------------------------------------------------------------------------
00149  * Lettering
00150  *----------------------------------------------------------------------------*/
00151 if ( $def==6 )
00152 {
00153     require_once('lettering.gestion.inc.php');
00154 }
00155 echo '</div>';
 All Data Structures Namespaces Files Functions Variables Enumerations