Merge pull request #508 from simnandez/develop
Fix: Add to areas not working if we navigate with shownavref
This commit is contained in:
commit
d30b74e69e
@ -62,10 +62,12 @@ For users:
|
||||
- New: Can choose menu entry to show with external site module.
|
||||
- New: Add hidden option MAIN_PDF_MARGIN_LEFT, MAIN_PDF_MARGIN_RIGHT, MAIN_PDF_MARGIN_TOP, MAIN_PDF_MARGIN_BOTTOM
|
||||
to force margins of generated PDF.
|
||||
- New: [ task #314 ] Can define if prof id are mandatory or not
|
||||
New experimental modules:
|
||||
- New: Add margin management module.
|
||||
- New: Add commissions management module.
|
||||
|
||||
|
||||
- Fix: [ bug #499 ]: Supplier order input method not translated
|
||||
- Fix: No images into product description lines as PDF generation does
|
||||
not work with this.
|
||||
|
||||
@ -949,6 +949,7 @@ DocumentModelOdt=Generació des dels documents amb format OpenDocument (Arxiu .O
|
||||
WatermarkOnDraft=Marca d'aigua en els documents esborrany
|
||||
CompanyIdProfChecker=Id Professional únic
|
||||
MustBeUnique=Ha de ser únic?
|
||||
MustBeMandatory=Ha de ser obligatori?
|
||||
Miscellanous=Miscel·lània
|
||||
##### Webcal setup #####
|
||||
WebCalSetup=Configuració d'enllaç amb el calendari webcalendar
|
||||
|
||||
@ -108,42 +108,49 @@ ProfId2AR=Ingressos bruts
|
||||
ProfId3AR=-
|
||||
ProfId4AR=-
|
||||
ProfId5AR=-
|
||||
ProfId6AR=-
|
||||
ProfId1AU=ABN
|
||||
ProfId2AU=-
|
||||
ProfId3AU=-
|
||||
ProfId4AU=-
|
||||
ProfId5AU=-
|
||||
ProfId6AU=-
|
||||
ProfId1BE=N° col·legiat
|
||||
ProfId2BE=-
|
||||
ProfId3BE=-
|
||||
ProfId4BE=-
|
||||
ProfId5BE=-
|
||||
ProfId1BR=CNPJ
|
||||
ProfId6BE=-
|
||||
ProfId1BR=-
|
||||
ProfId2BR=IE (Inscricao Estadual)
|
||||
ProfId3BR=IM (Inscricao Municipal)
|
||||
ProfId4BR=CPF
|
||||
#ProfId5BR=CNAE=
|
||||
#ProfId6BR=INSS=
|
||||
#ProfId5BR=CNAE
|
||||
#ProfId6BR=INSS
|
||||
ProfId1CH=-
|
||||
ProfId2CH=-
|
||||
ProfId3CH=Número federat
|
||||
ProfId4CH=Num registre de comerç
|
||||
ProfId5CH=-
|
||||
ProfId6CH=-
|
||||
ProfId1CL=R.U.T.
|
||||
ProfId2CL=-
|
||||
ProfId3CL=-
|
||||
ProfId4CL=-
|
||||
ProfId5CL=-
|
||||
ProfId6CL=-
|
||||
ProfId1CO=R.U.T.
|
||||
ProfId2CO=-
|
||||
ProfId3CO=-
|
||||
ProfId4CO=-
|
||||
ProfId5CO=-
|
||||
ProfId6CO=-
|
||||
ProfId1DE=Id prof. 1 (USt.-IdNr)
|
||||
ProfId2DE=Id prof. 2 (USt.-Nr)
|
||||
ProfId3DE=Id prof. 3 (Handelsregister-Nr.)
|
||||
ProfId4DE=-
|
||||
ProfId5DE=-
|
||||
ProfId6DE=-
|
||||
ProfId1ES=CIF/NIF
|
||||
ProfId2ES=Núm seguretat social
|
||||
ProfId3ES=CNAE
|
||||
@ -161,51 +168,61 @@ ProfId2GB=-
|
||||
ProfId3GB=SIC
|
||||
ProfId4GB=-
|
||||
ProfId5GB=-
|
||||
ProfId6GB=-
|
||||
ProfId1HN=RTN
|
||||
ProfId2HN=-
|
||||
ProfId3HN=-
|
||||
ProfId4HN=-
|
||||
ProfId5HN=-
|
||||
ProfId6HN=-
|
||||
ProfId1IN=Id prof. 1 (TIN)
|
||||
ProfId2IN=Id prof. 2
|
||||
ProfId3IN=Id prof. 3
|
||||
ProfId2IN=Id prof. 2 (PAN)
|
||||
ProfId3IN=Id prof. 3 (SRVC TAX)
|
||||
ProfId4IN=Id prof. 4
|
||||
ProfId5IN=Id prof. 5
|
||||
ProfId6IN=-
|
||||
ProfId1MA=Id prof. 1 (R.C.)
|
||||
ProfId2MA=Id prof. 2 (Patente)
|
||||
ProfId3MA=Id prof. 3 (I.F.)
|
||||
ProfId4MA=Id prof. 4 (C.N.S.S.)
|
||||
ProfId5MA=-
|
||||
ProfId6MA=-
|
||||
ProfId1MX=R.F.C.
|
||||
ProfId2MX=Registre Patronal IMSS
|
||||
ProfId3MX=Cèdula Professional
|
||||
ProfId4MX=-
|
||||
ProfId5MX=-
|
||||
ProfId6MX=-
|
||||
ProfId1NL=Número KVK
|
||||
ProfId2NL=-
|
||||
ProfId3NL=-
|
||||
ProfId4NL=-
|
||||
ProfId5NL=-
|
||||
ProfId6NL=-
|
||||
ProfId1PT=NIPC
|
||||
ProfId2PT=Núm seguretat social
|
||||
ProfId3PT=Num reg. comercial
|
||||
ProfId4PT=Conservatori
|
||||
ProfId5PT=-
|
||||
ProfId6PT=-
|
||||
ProfId1RU=OGRN
|
||||
ProfId2RU=INN
|
||||
ProfId3RU=KPP
|
||||
ProfId4RU=OKPO
|
||||
ProfId5RU=-
|
||||
ProfId6RU=-
|
||||
ProfId1SN=RC
|
||||
ProfId2SN=NINEA
|
||||
ProfId3SN=-
|
||||
ProfId4SN=-
|
||||
ProfId5SN=-
|
||||
ProfId6SN=-
|
||||
ProfId1TN=RC
|
||||
ProfId2TN=Matrícula fiscal
|
||||
ProfId3TN=Codi en aduana
|
||||
ProfId4TN=CCC
|
||||
ProfId5TN=-
|
||||
ProfId6TN=-
|
||||
VATIntra=NIF intracomunitari
|
||||
VATIntraShort=NIF intra.
|
||||
VATIntraVeryShort=NIF intra.
|
||||
|
||||
@ -21,6 +21,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Aquest contacte ja està definit com
|
||||
ErrorCashAccountAcceptsOnlyCashMoney=Aquesta compte bancari és de tipus caixa i només accepta el mètode de pagament de tipus <b>espècie</b>.
|
||||
ErrorFromToAccountsMustDiffers=El compte origen i destinació han de ser diferents.
|
||||
ErrorBadThirdPartyName=Nom de tercer incorrecte
|
||||
ErrorProdIdIsMandatory=El %s es obligatori
|
||||
ErrorBadCustomerCodeSyntax=La sintaxi del codi client és incorrecta
|
||||
ErrorCustomerCodeRequired=Codi client obligatori
|
||||
ErrorCustomerCodeAlreadyUsed=Codi de client ja utilitzat
|
||||
|
||||
@ -46,4 +46,8 @@ MargeNette=Marge net
|
||||
MARGIN_TYPE_DETAILS=Marge brut: Preu de venda sense IVA - Preu de compra sense IVA <br/> Marge net: Preu de venda sense IVA - Costos
|
||||
|
||||
BuyingCost=Costos
|
||||
UnitCharges=Càrrega unitària
|
||||
UnitCharges=Càrrega unitària
|
||||
Charges=Càrreges
|
||||
|
||||
AgentContactType=Tipus de contacte comissionat
|
||||
AgentContactTypeDetails=Indica el tipus de contacte enllaçat a les factures que seran associats als agents comercials
|
||||
@ -146,6 +146,8 @@ ProductSpecial=Especial
|
||||
QtyMin=Quantitat mínima
|
||||
PriceQty=Preu per la quantitat
|
||||
PriceQtyMin=Preu quantitat min.
|
||||
DiscountQtyMin=Descompte per defecte quantitat min.
|
||||
VATRateForSupplierProduct=Taxa IVA (per aquest producte/proveïdor)
|
||||
NoPriceDefinedForThisSupplier=Cap preu/quant. definit per a aquest proveïdor/producte
|
||||
NoSupplierPriceDefinedForThisProduct=Cap preu/quant. proveïdor definit per a aquest producte
|
||||
RecordedProducts=Productes en venda
|
||||
|
||||
@ -939,6 +939,7 @@ DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT files for
|
||||
WatermarkOnDraft=Watermark on draft document
|
||||
CompanyIdProfChecker=Professional Id unique
|
||||
MustBeUnique=Must be unique ?
|
||||
MustBeMandatory=Must be mandatory ?
|
||||
Miscellanous=Miscellaneous
|
||||
##### Webcal setup #####
|
||||
WebCalSetup=Webcalendar link setup
|
||||
|
||||
@ -25,6 +25,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=This contact is already defined as co
|
||||
ErrorCashAccountAcceptsOnlyCashMoney=This bank account is a cash account, so it accepts payments of type cash only.
|
||||
ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be different.
|
||||
ErrorBadThirdPartyName=Bad value for third party name
|
||||
ErrorProdIdIsMandatory=The %s is mandatory
|
||||
ErrorBadCustomerCodeSyntax=Bad syntax for customer code
|
||||
ErrorCustomerCodeRequired=Customer code required
|
||||
ErrorCustomerCodeAlreadyUsed=Customer code already used
|
||||
|
||||
@ -47,6 +47,7 @@ MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price<br/>Net margin : S
|
||||
|
||||
BuyingCost=Cost price
|
||||
UnitCharges=Unit charges
|
||||
Charges=Charges
|
||||
|
||||
AgentContactType=Contact type used for commissioning
|
||||
AgentContactTypeDetails=Défine what contact type (linked on invoices) will be associated with commercial agents
|
||||
@ -952,6 +952,7 @@ DocumentModelOdt=Generación desde los documentos OpenDocument (Archivo .ODT Ope
|
||||
WatermarkOnDraft=Marca de agua en los documentos borrador
|
||||
CompanyIdProfChecker=Id Profesional único
|
||||
MustBeUnique=¿Debe ser único?
|
||||
MustBeMandatory=¿Debe ser obligatorio?
|
||||
Miscellanous=Miscelánea
|
||||
##### Webcal setup #####
|
||||
WebCalSetup=Configuración de enlace con el calendario Webcalendar
|
||||
|
||||
@ -109,17 +109,20 @@ ProfId2AR=Ingresos brutos
|
||||
ProfId3AR=-
|
||||
ProfId4AR=-
|
||||
ProfId5AR=-
|
||||
ProfId6AR=-
|
||||
ProfId1AU=ABN
|
||||
ProfId2AU=-
|
||||
ProfId3AU=-
|
||||
ProfId4AU=-
|
||||
ProfId5AU=-
|
||||
ProfId6AU=-
|
||||
ProfId1BE=N° colegiado
|
||||
ProfId2BE=-
|
||||
ProfId3BE=-
|
||||
ProfId4BE=-
|
||||
ProfId5BE=-
|
||||
ProfId1BR=CNPJ
|
||||
ProfId6BE=-
|
||||
ProfId1BR=-
|
||||
ProfId2BR=IE (Inscricao Estadual)
|
||||
ProfId3BR=IM (Inscricao Municipal)
|
||||
ProfId4BR=CPF
|
||||
@ -130,21 +133,25 @@ ProfId2CH=-
|
||||
ProfId3CH=Número federado
|
||||
ProfId4CH=Num registro de comercio
|
||||
ProfId5CH=-
|
||||
ProfId6CH=-
|
||||
ProfId1CL=R.U.T.
|
||||
ProfId2CL=-
|
||||
ProfId3CL=-
|
||||
ProfId4CL=-
|
||||
ProfId5CL=-
|
||||
ProfId6CL=-
|
||||
ProfId1CO=R.U.T.
|
||||
ProfId2CO=-
|
||||
ProfId3CO=-
|
||||
ProfId4CO=-
|
||||
ProfId5CO=-
|
||||
ProfId6CO=-
|
||||
ProfId1DE=Id prof. 1 (USt.-IdNr)
|
||||
ProfId2DE=Id prof. 2 (USt.-Nr)
|
||||
ProfId3DE=Id prof. 3 (Handelsregister-Nr.)
|
||||
ProfId4DE=-
|
||||
ProfId5DE=-
|
||||
ProfId6DE=-
|
||||
ProfId1ES=CIF/NIF
|
||||
ProfId2ES=Núm seguridad social
|
||||
ProfId3ES=CNAE
|
||||
@ -162,51 +169,61 @@ ProfId2GB=-
|
||||
ProfId3GB=SIC
|
||||
ProfId4GB=-
|
||||
ProfId5GB=-
|
||||
ProfId6GB=-
|
||||
ProfId1HN=RTN
|
||||
ProfId2HN=-
|
||||
ProfId3HN=-
|
||||
ProfId4HN=-
|
||||
ProfId5HN=-
|
||||
ProfId6HN=-
|
||||
ProfId1IN=Id prof. 1 (TIN)
|
||||
ProfId2IN=Id prof. 2
|
||||
ProfId3IN=Id prof. 3
|
||||
ProfId4IN=Id prof. 4
|
||||
ProfId5IN=Id prof. 5
|
||||
ProfId6IN=-
|
||||
ProfId1MA=Id prof. 1 (R.C.)
|
||||
ProfId2MA=Id prof. 2 (Patente)
|
||||
ProfId3MA=Id prof. 3 (I.F.)
|
||||
ProfId4MA=Id prof. 4 (C.N.S.S.)
|
||||
ProfId5MA=Id prof. 5
|
||||
ProfId5MA=-
|
||||
ProfId6MA=-
|
||||
ProfId1MX=R.F.C.
|
||||
ProfId2MX=Registro Patronal IMSS
|
||||
ProfId3MX=Cédula Profesional
|
||||
ProfId4MX=-
|
||||
ProfId5MX=-
|
||||
ProfId6MX=-
|
||||
ProfId1NL=Número KVK
|
||||
ProfId2NL=-
|
||||
ProfId3NL=-
|
||||
ProfId4NL=-
|
||||
ProfId5NL=-
|
||||
ProfId6NL=-
|
||||
ProfId1PT=NIPC
|
||||
ProfId2PT=Núm. seguridad social
|
||||
ProfId3PT=Num reg. comercial
|
||||
ProfId4PT=Conservatorio
|
||||
ProfId5PT=-
|
||||
ProfId6PT=-
|
||||
ProfId1RU=OGRN
|
||||
ProfId2RU=INN
|
||||
ProfId3RU=KPP
|
||||
ProfId4RU=OKPO
|
||||
ProfId5RU=-
|
||||
ProfId6RU=-
|
||||
ProfId1SN=RC
|
||||
ProfId2SN=NINEA
|
||||
ProfId3SN=-
|
||||
ProfId4SN=-
|
||||
ProfId5SN=-
|
||||
ProfId6SN=-
|
||||
ProfId1TN=RC
|
||||
ProfId2TN=Matrícula fiscal
|
||||
ProfId3TN=Código en aduana
|
||||
ProfId4TN=CCC
|
||||
ProfId5TN=-
|
||||
ProfId6TN=-
|
||||
VATIntra=NIF intracomunitario
|
||||
VATIntraShort=NIF intra.
|
||||
VATIntraVeryShort=NIF intra.
|
||||
|
||||
@ -21,6 +21,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Este contacto ya está definido como
|
||||
ErrorCashAccountAcceptsOnlyCashMoney=Esta cuenta bancaria es de tipo caja y solo acepta el método de pago de tipo <b>especie</b>.
|
||||
ErrorFromToAccountsMustDiffers=La cuenta origen y destino deben ser diferentes.
|
||||
ErrorBadThirdPartyName=Nombre de tercero incorrecto
|
||||
ErrorProdIdIsMandatory=El %s es obligatorio
|
||||
ErrorBadCustomerCodeSyntax=La sintaxis del código cliente es incorrecta
|
||||
ErrorCustomerCodeRequired=Código cliente obligatorio
|
||||
ErrorCustomerCodeAlreadyUsed=Código de cliente ya utilizado
|
||||
|
||||
@ -46,4 +46,8 @@ MargeNette=Margen neto
|
||||
MARGIN_TYPE_DETAILS=Margen bruto : Precio de venta sin IVA - Precio de compra sin IVA<br/>Margen neto : Precio de venta sin IVA - Costos
|
||||
|
||||
BuyingCost=Costos
|
||||
UnitCharges=Carga unitaria
|
||||
UnitCharges=Carga unitaria
|
||||
Charges=Cargas
|
||||
|
||||
AgentContactType=Tipo de contacto comisionado
|
||||
AgentContactTypeDetails=Indica el tipo de contacto enlazado a las facturas que serán asociados a los agentes comerciales
|
||||
@ -146,6 +146,8 @@ ProductSpecial=Especial
|
||||
QtyMin=Cantidad mínima
|
||||
PriceQty=Precio para la cantidad
|
||||
PriceQtyMin=Precio cantidad mín.
|
||||
DiscountQtyMin=Descuento por defecto cantidad mín.
|
||||
VATRateForSupplierProduct=Tasa IVA (para este producto/proveedor)
|
||||
NoPriceDefinedForThisSupplier=Ningún precio/cant. definido para este proveedor/producto
|
||||
NoSupplierPriceDefinedForThisProduct=Ningún precio/cant. proveedor definida para este producto
|
||||
RecordedProducts=Productos en venta
|
||||
|
||||
@ -946,6 +946,7 @@ DocumentModelOdt=Genération depuis des modèles OpenDocument (Fichier .ODT Open
|
||||
WatermarkOnDraft=Filigrane sur les documents brouillons
|
||||
CompanyIdProfChecker=Id professionel unique
|
||||
MustBeUnique=Doit être unique ?
|
||||
MustBeMandatory=Doit être obligatoire?
|
||||
Miscellanous=Divers
|
||||
##### Webcal setup #####
|
||||
WebCalSetup= Configuration du lien vers le calendrier Webcalendar
|
||||
|
||||
@ -26,6 +26,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Ce contact est déjà défini comme c
|
||||
ErrorCashAccountAcceptsOnlyCashMoney=Ce compte bancaire est de type caisse et n'accepte que les mode de règlement de type <b>espèce</b>.
|
||||
ErrorFromToAccountsMustDiffers=Le compte source et destination doivent être différents.
|
||||
ErrorBadThirdPartyName=Nom de tiers incorrect
|
||||
ErrorProdIdIsMandatory=Le %s est obligatoire
|
||||
ErrorBadCustomerCodeSyntax=La syntaxe du code client est incorrecte
|
||||
ErrorCustomerCodeRequired=Code client obligatoire
|
||||
ErrorCustomerCodeAlreadyUsed=Code client déjà utilisé
|
||||
|
||||
@ -47,6 +47,7 @@ MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT<br/>Marge n
|
||||
|
||||
BuyingCost=Coût de revient
|
||||
UnitCharges=Charge unitaire
|
||||
Charges=Charges
|
||||
|
||||
AgentContactType=Type de contact commissionné
|
||||
AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux
|
||||
@ -1380,7 +1380,7 @@ print "\n</div><br>\n";
|
||||
* All the "Add to" areas
|
||||
*/
|
||||
|
||||
if ($id && ($action == '' || $action == 'view') && $object->status)
|
||||
if ($object->id && ($action == '' || $action == 'view') && $object->status)
|
||||
{
|
||||
print '<table width="100%" class="noborder">';
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -34,6 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
|
||||
$langs->load("products");
|
||||
$langs->load("suppliers");
|
||||
$langs->load("bills");
|
||||
// Charges ????
|
||||
if (! empty($conf->margin->enabled)) $langs->load("margins");
|
||||
|
||||
$id = GETPOST('id', 'int');
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
@ -195,6 +195,23 @@ if ($action == 'setprofid')
|
||||
}
|
||||
}
|
||||
|
||||
//Activate ProfId
|
||||
if ($action == 'setprofidmandatory')
|
||||
{
|
||||
$status = GETPOST('status','alpha');
|
||||
|
||||
$idprof="SOCIETE_IDPROF".$value."_MANDATORY";
|
||||
if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0)
|
||||
{
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($db);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
@ -522,6 +539,7 @@ print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Name").'</td>';
|
||||
print '<td>'.$langs->trans("Description").'</td>';
|
||||
print '<td align="center">'.$langs->trans("MustBeUnique").'</td>';
|
||||
print '<td align="center">'.$langs->trans("MustBeMandatory").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
$profid[0][0]=$langs->trans("ProfId1");
|
||||
@ -532,6 +550,10 @@ $profid[2][0]=$langs->trans("ProfId3");
|
||||
$profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code);
|
||||
$profid[3][0]=$langs->trans("ProfId4");
|
||||
$profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code);
|
||||
$profid[4][0]=$langs->trans("ProfId5");
|
||||
$profid[4][1]=$langs->transcountry('ProfId5', $mysoc->country_code);
|
||||
$profid[5][0]=$langs->trans("ProfId6");
|
||||
$profid[5][1]=$langs->transcountry('ProfId6', $mysoc->country_code);
|
||||
|
||||
$var = true;
|
||||
$i=0;
|
||||
@ -539,42 +561,47 @@ $i=0;
|
||||
$nbofloop=count($profid);
|
||||
while ($i < $nbofloop)
|
||||
{
|
||||
$var = !$var;
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$profid[$i][0]."</td><td>\n";
|
||||
print $profid[$i][1];
|
||||
print '</td>';
|
||||
|
||||
switch($i)
|
||||
if ($profid[$i][1]!='-')
|
||||
{
|
||||
case 0:
|
||||
$verif=(empty($conf->global->SOCIETE_IDPROF1_UNIQUE)?false:true);
|
||||
break;
|
||||
case 1:
|
||||
$verif=(empty($conf->global->SOCIETE_IDPROF2_UNIQUE)?false:true);
|
||||
break;
|
||||
case 2:
|
||||
$verif=(empty($conf->global->SOCIETE_IDPROF3_UNIQUE)?false:true);
|
||||
break;
|
||||
case 3:
|
||||
$verif=(empty($conf->global->SOCIETE_IDPROF4_UNIQUE)?false:true);
|
||||
break;
|
||||
$var = !$var;
|
||||
|
||||
print '<tr '.$bc[$var].'>';
|
||||
print '<td>'.$profid[$i][0]."</td><td>\n";
|
||||
print $profid[$i][1];
|
||||
print '</td>';
|
||||
|
||||
$idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE';
|
||||
$idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY';
|
||||
$verif=(empty($conf->global->$idprof_unique)?false:true);
|
||||
$mandatory=(empty($conf->global->$idprof_mandatory)?false:true);
|
||||
|
||||
if ($verif)
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=0">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=1">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
|
||||
if ($mandatory)
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=0">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofidmandatory&value='.($i+1).'&status=1">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
}
|
||||
|
||||
if ($verif)
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=0">';
|
||||
print img_picto($langs->trans("Activated"),'switch_on');
|
||||
print '</a></td>';
|
||||
}
|
||||
else
|
||||
{
|
||||
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setprofid&value='.($i+1).'&status=1">';
|
||||
print img_picto($langs->trans("Disabled"),'switch_off');
|
||||
print '</a></td>';
|
||||
}
|
||||
print "</tr>\n";
|
||||
$i++;
|
||||
}
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
* Copyright (C) 2008 Patrick Raguin <patrick.raguin@auguria.net>
|
||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* 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
|
||||
@ -202,9 +202,18 @@ if (empty($reshook))
|
||||
$error++; $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled");
|
||||
$action = ($action=='add'?'create':'edit');
|
||||
}
|
||||
|
||||
// We set country_id, country_code and country for the selected country
|
||||
$object->country_id=GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id;
|
||||
if ($object->country_id)
|
||||
{
|
||||
$tmparray=getCountry($object->country_id,'all');
|
||||
$object->country_code=$tmparray['code'];
|
||||
$object->country=$tmparray['label'];
|
||||
}
|
||||
|
||||
// Check for duplicate prof id
|
||||
for ($i = 1; $i < 3; $i++)
|
||||
// Check for duplicate or mandatory prof id
|
||||
for ($i = 1; $i < 5; $i++)
|
||||
{
|
||||
$slabel="idprof".$i;
|
||||
$_POST[$slabel]=trim($_POST[$slabel]);
|
||||
@ -218,8 +227,18 @@ if (empty($reshook))
|
||||
$action = ($action=='add'?'create':'edit');
|
||||
}
|
||||
}
|
||||
|
||||
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
||||
if (! $vallabel && ! empty($conf->global->$idprof_mandatory))
|
||||
{
|
||||
$langs->load("errors");
|
||||
$error++;
|
||||
$errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code));
|
||||
$action = ($action=='add'?'create':'edit');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
if ($action == 'add')
|
||||
@ -293,7 +312,7 @@ if (empty($reshook))
|
||||
// Gestion du logo de la société
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
$error=$object->error; $errors=$object->errors;
|
||||
}
|
||||
|
||||
@ -834,7 +853,13 @@ else
|
||||
if ($idprof!='-')
|
||||
{
|
||||
if (($j % 2) == 0) print '<tr>';
|
||||
print '<td>'.$idprof.'</td><td>';
|
||||
|
||||
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
||||
if(empty($conf->global->$idprof_mandatory))
|
||||
print '<td>'.$idprof.'</td><td>';
|
||||
else
|
||||
print '<td><span class="fieldrequired">'.$idprof.'</td><td>';
|
||||
|
||||
$key='idprof'.$i;
|
||||
print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code);
|
||||
print '</td>';
|
||||
@ -1271,7 +1296,13 @@ else
|
||||
if ($idprof!='-')
|
||||
{
|
||||
if (($j % 2) == 0) print '<tr>';
|
||||
print '<td>'.$idprof.'</td><td>';
|
||||
|
||||
$idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY';
|
||||
if(empty($conf->global->$idprof_mandatory))
|
||||
print '<td>'.$idprof.'</td><td>';
|
||||
else
|
||||
print '<td><span class="fieldrequired">'.$idprof.'</td><td>';
|
||||
|
||||
$key='idprof'.$i;
|
||||
print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code);
|
||||
print '</td>';
|
||||
|
||||
Loading…
Reference in New Issue
Block a user