noalyss  Version-6.7.2
 All Data Structures Namespaces Files Functions Variables Enumerations
modele_document.php
Go to the documentation of this file.
00001 <?php
00002 //This file is part of NOALYSS and is under GPL 
00003 //see licence.txt
00004 ?><?php echo HtmlInput::anchor_close('mod_doc');?>
00005 <h2 class="info">"<?php echo _("Modèle de document")?></h2>
00006 <form  method="post" enctype="multipart/form-data">
00007 <table>
00008 
00009 <tr>
00010 <td><?php echo _("Nom du document")?></td>
00011 
00012 <td>
00013 <?php
00014 $a=new IText('md_name');
00015 $a->value=$doc->md_name;
00016 echo $a->input();
00017 ?>
00018 </td>
00019 </tr>
00020 
00021 <tr>
00022 <td>
00023 <?php echo _("Catégorie de document")?>
00024 </td>
00025 <td>
00026 <?php
00027 // Load all the category
00028           $w=new ISelect();
00029      $w->name="md_type";
00030 
00031      $w->value=$cn->make_array('select dt_id,dt_value from document_type order by dt_value');
00032      $w->selected=$doc->md_type;
00033      echo $w->input();
00034 ?>
00035 
00036 </td>
00037 </tr>
00038 <tr>
00039 <td>
00040 <?php echo _("Affectation")?>
00041 </td>
00042 <td>
00043 <?php
00044 
00045        $waffect=new ISelect();
00046         $waffect->name='md_affect';
00047         $waffect->value=array(
00048                             array('value'=>'ACH','label'=>_('Uniquement journaux achat')),
00049                             array('value'=>'VEN','label'=>_('Uniquement journaux vente')),
00050                             array('value'=>'GES','label'=>_('Partie gestion'))
00051                         );
00052        $waffect->selected=$doc->md_affect;
00053        echo $waffect->input();
00054 ?>
00055 </td>
00056 </tr>
00057 <tr>
00058 
00059 <tr>
00060 <td>
00061 <?php echo _("Fichier")?>
00062 <?php
00063                 $s=dossier::get();
00064 
00065            echo '<A HREF="show_document_modele.php?md_id='.$doc->md_id.'&'.$s.'">(fichier actuel)</a>';
00066 ?>
00067 </td>
00068 <td>
00069 <?php
00070 $file=new IFile('doc');
00071 echo $file->input();
00072 
00073 
00074 ?>
00075 </td>
00076 </tr>
00077 
00078 <tr>
00079 <td>
00080 <?php echo _("Dernier numéro utilisé pour ce type de document")?>
00081 </td>
00082 <td>
00083 <?php
00084 $last=0;
00085          if ( $cn->exist_sequence("seq_doc_type_".$doc->md_type) )
00086          {
00087              $ret= $cn->get_array("select last_value,is_called from seq_doc_type_".$doc->md_type) ;
00088 
00089              $last=$ret[0]['last_value'];
00090              /*!
00091                   *\note  With PSQL sequence , the last_value column is 1 when before   AND after the first call, to make the difference between them
00092                   * I have to check whether the sequence has been already called or not */
00093              if ($ret[0]['is_called']=='f' ) $last--;
00094          }
00095 echo $last;
00096 ?>
00097 </td>
00098 </tr>
00099 <tr>
00100 <td>
00101 <?php echo _("Redémarrer la séquence (laisser à 0 pour ne pas changer)")?>
00102 </td>
00103 <td>
00104 <?php
00105 $pj=new INum('seq');
00106 $pj->value=0;
00107 echo $pj->input();
00108 ?>
00109 </td>
00110 </tr>
00111 
00112 </table>
00113 <?php
00114 echo HtmlInput::hidden('p_action','document');
00115 echo dossier::hidden();
00116 echo HtmlInput::hidden('sa','mod_template');
00117 echo HtmlInput::hidden('id',$doc->md_id);
00118 echo HtmlInput::submit("mod",_('Sauver'));
00119 
00120 ?>
00121 </form>
 All Data Structures Namespaces Files Functions Variables Enumerations