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=7;
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 echo ShowItem(array(
00065                   array($root."&sc=dc",_('Fiche'),_('Détail de la fiche'),1),
00066                   array($root.'&sc=sv',_('Suivi'),_('Suivi Fournisseur, client, banque, devis, bon de commande, courrier'),2),
00067                   array($root.'&sc=cn',_('Contact'),_('Liste de contacts'),3),
00068                   array($root.'&sc=op',_('Opérations'),_('Toutes les opérations'),4),
00069                   array($root.'&sc=bal',_('Balance'),_('Balance du fournisseur'),7),
00070                   array($root.'&sc=let',_('Lettrage'),_('Opérations & Lettrages'),6)
00071                   ),
00072                   'H',"mtitle","mtitle",$def,' ');
00073 echo '</div>';
00074 echo '<div>';
00075 
00076 
00077 //---------------------------------------------------------------------------
00078 // Show Detail of a card and category
00079 //---------------------------------------------------------------------------
00080 if ( $ss_action == 'dc' )
00081 {
00082     require_once('category_detail.inc.php');
00083 }
00084 //---------------------------------------------------------------------------
00085 // Follow up : mail, bons de commande, livraison, rendez-vous...
00086 //---------------------------------------------------------------------------
00087 if ( $ss_action == 'sv' )
00088 {
00089     require_once('category_followup.inc.php');
00090 }
00091 /*----------------------------------------------------------------------
00092  * Operation all the operation of this customer
00093  *
00094  * ----------------------------------------------------------------------*/
00095 if ( $ss_action == 'op')
00096 {
00097     require_once('category_operation.inc.php');
00098 }
00099 /*-------------------------------------------------------------------------
00100  * Balance of the card
00101  *-------------------------------------------------------------------------*/
00102 if ( $ss_action=='bal')
00103   {
00104     require_once('balance_card.inc.php');
00105   }
00106 /*----------------------------------------------------------------------
00107  * All the contact
00108  *
00109  *----------------------------------------------------------------------*/
00110 if ( $ss_action == 'cn')
00111 {
00112     echo '<div class="content">';
00113 
00114         echo dossier::hidden();
00115         $f = new Fiche($cn, $_REQUEST['f_id']);
00116         $contact=new Contact($cn);
00117     $contact->company=$f->get_quick_code();
00118     echo $contact->summary("");
00119 
00120     $sql=' select fd_id from fiche_def where frd_id='.FICHE_TYPE_CONTACT;
00121     $filter=$cn->make_list($sql);
00122     if ( empty ($filter))
00123     {
00124         echo '<span class="notice">';
00125         echo _("Vous devez aller dans fiche et créer une catégorie pour les contacts");
00126         echo '</span>';
00127         exit();
00128     }
00129     /* Add button */
00130     $f_add_button=new IButton('add_card');
00131     $f_add_button->label=_('Créer une nouvelle fiche');
00132 
00133     $f_add_button->set_attribute('filter',$filter);
00134     $f_add_button->javascript=" select_card_type(this);";
00135 
00136     echo $f_add_button->input();
00137     echo '</div>';
00138 }
00139 /*----------------------------------------------------------------------------
00140  * Lettering
00141  *----------------------------------------------------------------------------*/
00142 if ( $def==6 )
00143 {
00144     require_once('lettering.gestion.inc.php');
00145 }
 All Data Structures Namespaces Files Functions Variables Enumerations