Fix: Correction plus complete de la possibilité de modifier le code client avec zebre.

This commit is contained in:
Laurent Destailleur 2007-10-30 20:08:28 +00:00
parent 39b908c556
commit 7927b9a5c8
5 changed files with 22 additions and 28 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Éric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Éric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2005-2007 Laurent Destailleur <eldy@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -18,7 +18,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$ * $Id$
* $Source$
*/ */
/** /**
@ -111,7 +110,7 @@ print ' <td>'.$langs->trans("Name").'</td>';
print ' <td>'.$langs->trans("Description").'</td>'; print ' <td>'.$langs->trans("Description").'</td>';
print ' <td>'.$langs->trans("Example").'</td>'; print ' <td>'.$langs->trans("Example").'</td>';
print ' <td align="center">'.$langs->trans("Activated").'</td>'; print ' <td align="center">'.$langs->trans("Activated").'</td>';
print ' <td>&nbsp;</td>'; print ' <td align="center" width="20">'.$langs->trans("Infos").'</td>';
print "</tr>\n"; print "</tr>\n";
clearstatcache(); clearstatcache();
@ -145,17 +144,20 @@ if ($handle)
if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file") if ($conf->global->SOCIETE_CODECLIENT_ADDON == "$file")
{ {
print " <td align=\"center\">\n"; print "<td align=\"center\">\n";
print img_tick(); print img_tick();
print "</td>\n <td>&nbsp;</td>\n"; print "</td>\n";
} }
else else
{ {
print '<td>&nbsp;</td>';
print '<td align="center"><a href="societe.php?action=setcodeclient&amp;value='.$file.'">'.$langs->trans("Activate").'</a></td>'; print '<td align="center"><a href="societe.php?action=setcodeclient&amp;value='.$file.'">'.$langs->trans("Activate").'</a></td>';
} }
print '<td align="center">';
$s=$modCodeTiers->getToolTip($langs,$soc,-1);
print $form->textwithhelp('',$s,1);
print '</td>';
print '</tr>'; print '</tr>';
} }
} }
@ -177,7 +179,7 @@ print '<td>'.$langs->trans("Name").'</td>';
print '<td>'.$langs->trans("Description").'</td>'; print '<td>'.$langs->trans("Description").'</td>';
print '<td>'.$langs->trans("Example").'</td>'; print '<td>'.$langs->trans("Example").'</td>';
print '<td align="center">'.$langs->trans("Activated").'</td>'; print '<td align="center">'.$langs->trans("Activated").'</td>';
print '<td>&nbsp;</td>'; print '<td align="center" width="20">&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
clearstatcache(); clearstatcache();
@ -208,15 +210,14 @@ if ($handle)
{ {
print '<td align="center">'; print '<td align="center">';
print img_tick(); print img_tick();
print '</td><td>&nbsp;</td>'; print '</td>';
} }
else else
{ {
print '<td>&nbsp;</td>';
print '<td align="center"><a href="societe.php?action=setcodecompta&amp;value='.$file.'">'.$langs->trans("Activate").'</a></td>'; print '<td align="center"><a href="societe.php?action=setcodecompta&amp;value='.$file.'">'.$langs->trans("Activate").'</a></td>';
} }
print '<td>&nbsp;</td>';
print "</tr>\n"; print "</tr>\n";
} }
} }

View File

@ -128,6 +128,7 @@ class ModeleThirdPartyCode
if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>'; if ($type != -1) $s.=$langs->trans("ValidityControledByModule").': <b>'.$this->getNom($langs).'</b><br>';
if ($type == 0) $s.=$langs->trans("RequiredIfCustomer").': <b>'.yn(!$this->code_null).'</b><br>'; if ($type == 0) $s.=$langs->trans("RequiredIfCustomer").': <b>'.yn(!$this->code_null).'</b><br>';
if ($type == 1) $s.=$langs->trans("RequiredIfSupplier").': <b>'.yn(!$this->code_null).'</b><br>'; if ($type == 1) $s.=$langs->trans("RequiredIfSupplier").': <b>'.yn(!$this->code_null).'</b><br>';
if ($type == -1) $s.=$langs->trans("Required").': <b>'.yn(!$this->code_null).'</b><br>';
$s.=$langs->trans("CanBeModifiedIfOk").': <b>'.yn($this->code_modifiable).'</b><br>'; $s.=$langs->trans("CanBeModifiedIfOk").': <b>'.yn($this->code_modifiable).'</b><br>';
$s.=$langs->trans("CanBeModifiedIfKo").': <b>'.yn($this->code_modifiable_invalide).'</b><br>'; $s.=$langs->trans("CanBeModifiedIfKo").': <b>'.yn($this->code_modifiable_invalide).'</b><br>';
if ($type != -1) $s.=$langs->trans("Example").': <b>'.$this->getExample($langs,$soc,1).'</b>'; if ($type != -1) $s.=$langs->trans("Example").': <b>'.$this->getExample($langs,$soc,1).'</b>';

View File

@ -387,6 +387,8 @@ DetectedVersion=Detected version
FollowingConstantsWillBeSubstituted=Following constants will be substitute with corresponding value. FollowingConstantsWillBeSubstituted=Following constants will be substitute with corresponding value.
Refresh=Refresh Refresh=Refresh
BackToList=Back to list BackToList=Back to list
CanBeModifiedIfOk=Can be modified if valid
CanBeModifiedIfKo=Can be modified if not valid
# Week day # Week day
Monday=Monday Monday=Monday
Tuesday=Tuesday Tuesday=Tuesday

View File

@ -388,6 +388,8 @@ DetectedVersion=Version d
FollowingConstantsWillBeSubstituted=Les constantes suivantes seront substituées par leur valeur correspondante. FollowingConstantsWillBeSubstituted=Les constantes suivantes seront substituées par leur valeur correspondante.
Refresh=Rafraichir Refresh=Rafraichir
BackToList=Retour liste BackToList=Retour liste
CanBeModifiedIfOk=Peut ętre modifié si valide
CanBeModifiedIfKo=Peut ętre modifié si invalide
# Week day # Week day
Monday=Lundi Monday=Lundi
Tuesday=Mardi Tuesday=Mardi

View File

@ -349,10 +349,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
print '<input type="text" name="code_client" size="16" value="'.$soc->code_client.'" maxlength="15">'; print '<input type="text" name="code_client" size="16" value="'.$soc->code_client.'" maxlength="15">';
} }
print '</td><td>'; print '</td><td>';
$s=$langs->trans("CustomerCodeDesc").'<br>'; $s=$modCodeClient->getToolTip($langs,$soc,0);
$s.=$langs->trans("ValidityControledByModule").': <b>'.$modCodeClient->getNom($langs).'</b><br>';
$s.=$langs->trans("RequiredIfCustomer").': <b>'.yn(!$modCodeClient->code_null).'</b><br>';
$s.=$langs->trans("Example").': <b>'.$modCodeClient->getExample($langs,$soc,1).'</b>';
print $form->textwithhelp('',$s,1); print $form->textwithhelp('',$s,1);
print '</td></tr></table>'; print '</td></tr></table>';
@ -374,10 +371,7 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] ||
print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">'; print '<input type="text" name="code_fournisseur" size="16" value="'.$soc->code_fournisseur.'" maxlength="15">';
} }
print '</td><td>'; print '</td><td>';
$s=$langs->trans("SupplierCodeDesc").'<br>'; $s=$modCodeFournisseur->getToolTip($langs,$soc,1);
$s.=$langs->trans("ValidityControledByModule").': <b>'.$modCodeFournisseur->getNom($langs).'</b><br>';
$s.=$langs->trans("RequiredIfSupplier").': <b>'.yn(!$modCodeFournisseur->code_null).'</b><br>';
$s.=$langs->trans("Example").': <b>'.$modCodeFournisseur->getExample($langs,$soc,2).'</b>';
print $form->textwithhelp('',$s,1); print $form->textwithhelp('',$s,1);
print '</td></tr></table>'; print '</td></tr></table>';
@ -682,10 +676,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
print '<input type="hidden" name="code_client" value="'.$soc->code_client.'">'; print '<input type="hidden" name="code_client" value="'.$soc->code_client.'">';
} }
print '</td><td>'; print '</td><td>';
$s=$langs->trans("CustomerCodeDesc").'<br>'; $s=$modCodeClient->getToolTip($langs,$soc,0);
$s.=$langs->trans("ValidityControledByModule").': <b>'.$modCodeClient->getNom($langs).'</b><br>';
$s.=$langs->trans("RequiredIfCustomer").': <b>'.yn(!$modCodeClient->code_null).'</b><br>';
$s.=$langs->trans("Example").': <b>'.$modCodeClient->getExample($langs,$soc,1).'</b>';
print $form->textwithhelp('',$s,1); print $form->textwithhelp('',$s,1);
print '</td></tr></table>'; print '</td></tr></table>';
@ -709,10 +700,7 @@ elseif ($_GET["action"] == 'edit' || $_POST["action"] == 'edit')
print '<input type="hidden" name="code_fournisseur" value="'.$soc->code_fournisseur.'">'; print '<input type="hidden" name="code_fournisseur" value="'.$soc->code_fournisseur.'">';
} }
print '</td><td>'; print '</td><td>';
$s=$langs->trans("SupplierCodeDesc").'<br>'; $s=$modCodeFournisseur->getToolTip($langs,$soc,1);
$s.=$langs->trans("ValidityControledByModule").': <b>'.$modCodeFournisseur->getNom($langs).'</b><br>';
$s.=$langs->trans("RequiredIfSupplier").': <b>'.yn(!$modCodeFournisseur->code_null).'</b><br>';
$s.=$langs->trans("Example").': <b>'.$modCodeFournisseur->getExample($langs,$soc,2).'</b>';
print $form->textwithhelp('',$s,1); print $form->textwithhelp('',$s,1);
print '</td></tr></table>'; print '</td></tr></table>';