Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-10-21 15:51:03 +02:00
commit bba5057d5d
24 changed files with 162 additions and 118 deletions

View File

@ -31,9 +31,9 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
$langs->load("errors");
$langs->load("admin");
$mode=isset($_GET["mode"])?GETPOST("mode"):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
$mode=GETPOST('mode', 'alpha')?GETPOST('mode', 'alpha'):(isset($_SESSION['mode'])?$_SESSION['mode']:0);
$action=GETPOST('action','alpha');
$value=GETPOST('value');
$value=GETPOST('value', 'alpha');
if (! $user->admin)
accessforbidden();

View File

@ -28,12 +28,14 @@ require_once DOL_DOCUMENT_ROOT.'/bookmarks/class/bookmark.class.php';
$langs->load("other");
$action=GETPOST("action");
$title=GETPOST("title");
$url=GETPOST("url");
$target=GETPOST("target");
$userid=GETPOST("userid");
$position=GETPOST("position");
$id=GETPOST("id");
$action=GETPOST("action","alpha");
$title=GETPOST("title","alpha");
$url=GETPOST("url","alpha");
$target=GETPOST("target","alpha");
$userid=GETPOST("userid","int");
$position=GETPOST("position","int");
$backtopage=GETPOST('backtopage','alpha');
/*
@ -42,10 +44,10 @@ $position=GETPOST("position");
if ($action == 'add' || $action == 'addproduct' || $action == 'update')
{
if ($_POST["cancel"])
if (GETPOST("cancel"))
{
$urlsource=(! empty($_REQUEST["urlsource"]))?$_REQUEST["urlsource"]:((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/liste.php');
header("Location: ".$urlsource);
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):((! empty($url))?$url:DOL_URL_ROOT.'/bookmarks/liste.php'));
header("Location: ".$backtopage);
exit;
}
@ -71,8 +73,8 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
if ($res > 0)
{
$urlsource=! empty($_REQUEST["urlsource"])?urldecode($_REQUEST["urlsource"]):DOL_URL_ROOT.'/bookmarks/liste.php';
header("Location: ".$urlsource);
if (empty($backtopage)) $backtopage=(GETPOST("urlsource")?GETPOST("urlsource"):DOL_URL_ROOT.'/bookmarks/liste.php');
header("Location: ".$backtopage);
exit;
}
else
@ -96,7 +98,7 @@ if ($action == 'add' || $action == 'addproduct' || $action == 'update')
}
}
if ($_GET["action"] == 'delete')
if ($action == 'delete')
{
$bookmark=new Bookmark($db);
$bookmark->id=$_GET["bid"];
@ -133,10 +135,10 @@ if ($action == 'create')
* Fact bookmark creation mode
*/
print '<form action="fiche.php" method="post" enctype="multipart/form-data">'."\n";
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST" enctype="multipart/form-data">'."\n";
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
print_fiche_titre($langs->trans("NewBookmark"));
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
@ -176,24 +178,25 @@ if ($action == 'create')
}
if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
if ($id > 0 && ! preg_match('/^add/i',$action))
{
/*
* Fact bookmark mode or visually edition
*/
$bookmark=new Bookmark($db);
$bookmark->fetch($_GET["id"]);
$bookmark->fetch($id);
dol_fiche_head($head, $hselected, $langs->trans("Bookmark"),0,'bookmark');
if ($_GET["action"] == 'edit')
if ($action == 'edit')
{
print '<form name="edit" method="POST" action="'.$_SERVER["PHP_SELF"].'" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">';
print '<input type="hidden" name="id" value="'.$bookmark->id.'">';
print '<input type="hidden" name="urlsource" value="'.DOL_URL_ROOT.'/bookmarks/fiche.php?id='.$bookmark->id.'">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
}
print '<table class="border" width="100%">';
@ -201,17 +204,17 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
print '<tr><td width="25%">'.$langs->trans("Ref").'</td><td>'.$bookmark->ref.'</td></tr>';
print '<tr><td>'.$langs->trans("BookmarkTitle").'</td><td>';
if ($_GET["action"] == 'edit') print '<input class="flat" name="title" size="30" value="'.(isset($_POST["title"])?$_POST["title"]:$bookmark->title).'">';
if ($action == 'edit') print '<input class="flat" name="title" size="30" value="'.(isset($_POST["title"])?$_POST["title"]:$bookmark->title).'">';
else print $bookmark->title;
print '</td></tr>';
print '<tr><td>'.$langs->trans("UrlOrLink").'</td><td>';
if ($_GET["action"] == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
if ($action == 'edit') print '<input class="flat" name="url" size="80" value="'.(isset($_POST["url"])?$_POST["url"]:$bookmark->url).'">';
else print '<a href="'.(preg_match('/^http/i',$bookmark->url)?$bookmark->url:DOL_URL_ROOT.$bookmark->url).'"'.($bookmark->target?' target="_blank"':'').'>'.$bookmark->url.'</a>';
print '</td></tr>';
print '<tr><td>'.$langs->trans("BehaviourOnClick").'</td><td>';
if ($_GET["action"] == 'edit')
if ($action == 'edit')
{
$liste=array(1=>$langs->trans("OpenANewWindow"),0=>$langs->trans("ReplaceWindow"));
print $form->selectarray('target',$liste,isset($_POST["target"])?$_POST["target"]:$bookmark->target);
@ -224,7 +227,7 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
print '</td></tr>';
print '<tr><td>'.$langs->trans("Owner").'</td><td>';
if ($_GET["action"] == 'edit' && $user->admin)
if ($action == 'edit' && $user->admin)
{
$form->select_users(isset($_POST['userid'])?$_POST['userid']:($bookmark->fk_user?$bookmark->fk_user:''),'userid',1);
}
@ -245,7 +248,7 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
// Position
print '<tr><td>'.$langs->trans("Position").'</td><td>';
if ($_GET["action"] == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
if ($action == 'edit') print '<input class="flat" name="position" size="5" value="'.(isset($_POST["position"])?$_POST["position"]:$bookmark->position).'">';
else print $bookmark->position;
print '</td></tr>';
@ -254,9 +257,9 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
print '</table>';
if ($_GET["action"] == 'edit') print '<br><div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
if ($action == 'edit') print '<br><div align="center"><input class="button" type="submit" name="save" value="'.$langs->trans("Save").'"> &nbsp; &nbsp; <input class="button" type="submit" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
if ($_GET["action"] == 'edit') print '</form>';
if ($action == 'edit') print '</form>';
dol_fiche_end();
@ -264,13 +267,13 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
print "<div class=\"tabsAction\">\n";
// Edit
if ($user->rights->bookmark->creer && $_GET["action"] != 'edit')
if ($user->rights->bookmark->creer && $action != 'edit')
{
print " <a class=\"butAction\" href=\"".$_SERVER["PHP_SELF"]."?id=".$bookmark->id."&amp;action=edit\">".$langs->trans("Edit")."</a>\n";
}
// Remove
if ($user->rights->bookmark->supprimer && $_GET["action"] != 'edit')
if ($user->rights->bookmark->supprimer && $action != 'edit')
{
print " <a class=\"butActionDelete\" href=\"liste.php?bid=".$bookmark->id."&amp;action=delete\">".$langs->trans("Delete")."</a>\n";
}
@ -279,8 +282,8 @@ if ($_GET["id"] > 0 && ! preg_match('/^add/i',$_GET["action"]))
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -170,7 +170,11 @@ if ($resql)
print '<td align="right">'.$obj->position."</td>";
// Actions
print '<td align="right">';
print '<td align="right" nowrap="nowrap">';
if ($user->rights->bookmark->creer)
{
print "<a href=\"".DOL_URL_ROOT."/bookmarks/fiche.php?action=edit&id=".$obj->bid."&backtopage=".urlencode($_SERVER["PHP_SELF"])."\">".img_edit()."</a> ";
}
if ($user->rights->bookmark->supprimer)
{
print "<a href=\"".$_SERVER["PHP_SELF"]."?action=delete&bid=$obj->bid\">".img_delete()."</a>";

View File

@ -56,10 +56,19 @@ $search_sale = GETPOST("search_sale");
$search_categ = GETPOST("search_categ",'int');
$catid = GETPOST("catid",'int');
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
$hookmanager=new HookManager($db);
$hookmanager->initHooks(array('customerlist'));
/*
* Actions
*/
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
// Do we click on purge search criteria ?
if (GETPOST("button_removefilter_x"))
{
@ -140,8 +149,7 @@ if ($result)
$i = 0;
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">'."\n";
print '<table class="liste" width="100%">'."\n";
print '<form method="GET" id="formList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
// Filter on categories
$moreforfilter='';
@ -159,12 +167,13 @@ if ($result)
}
if ($moreforfilter)
{
print '<tr class="liste_titre">';
print '<td class="liste_titre" colspan="6">';
print '<div class="liste_titre">';
print $moreforfilter;
print '</td></tr>';
print '</div>';
}
print '<table class="liste" width="100%">'."\n";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Town"),$_SERVER["PHP_SELF"],"s.ville","",$param,"",$sortfield,$sortorder);
@ -172,7 +181,11 @@ if ($result)
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="right"',$sortfield,$sortorder);
print "</tr>\n";
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
print '<tr class="liste_titre">';
@ -199,6 +212,9 @@ if ($result)
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.DOL_URL_ROOT.'/theme/'.$conf->theme.'/img/searchclear.png" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
$var=True;
@ -224,6 +240,10 @@ if ($result)
print '<td align="right">'.dol_print_date($db->jdate($obj->datec),'day').'</td>';
print '<td align="right">'.$thirdpartystatic->getLibStatut(3);
print '</td>';
$parameters=array('obj' => $obj);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
$i++;
}
@ -231,13 +251,15 @@ if ($result)
print "</table>\n";
print "</form>\n";
$db->free($result);
$parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
}
else
{
dol_print_error($db);
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -249,7 +249,7 @@ class Translate
$tab=explode('=',$line,2);
$key=trim($tab[0]);
//print "Domain=$domain, found a string for $tab[0] with value $tab[1]<br>";
if ((! empty($conf->global->MAIN_USE_CUSTOM_TRANSLATION) || empty($this->tab_translate[$key])) && isset($tab[1])) // If data was already found, we must not enter here, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite)
if ((! empty($conf->global->MAIN_USE_CUSTOM_TRANSLATION) || empty($this->tab_translate[$key])) && isset($tab[1])) // If translation was already found, we must not continue, even if MAIN_FORCELANGDIR is set (MAIN_FORCELANGDIR is to replace lang dir, not to overwrite entries)
{
$value=trim(preg_replace('/\\n/',"\n",$tab[1]));

View File

@ -4,6 +4,7 @@
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 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
@ -362,6 +363,26 @@ class modSociete extends DolibarrModules
//$this->import_convertvalue_array[$r]=array('s.fk_soc'=>array('rule'=>'lastrowid',table='t');
$this->import_regex_array[$r]=array('s.birthday'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$','s.datec'=>'^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]$');
$this->import_examplevalues_array[$r]=array('s.fk_soc'=>'MyBigCompany','s.civilite'=>"MR",'s.name'=>"Smith",'s.firstname'=>'John','s.address'=>'61 jump street','s.cp'=>'75000','s.ville'=>'Bigtown','s.fk_pays'=>'US, FR, DE...','s.datec'=>'1972-10-10','s.poste'=>"Director",'s.phone'=>"5551122",'s.phone_perso'=>"5551133",'s.phone_mobile'=>"5551144",'s.fax'=>"5551155",'s.email'=>"johnsmith@email.com",'s.note'=>"My comments");
// Import Bank Accounts
$r++;
$this->import_code[$r]=$this->rights_class.'_'.$r;
$this->import_label[$r]="ImportDataset_company_3"; // Translation key
$this->import_icon[$r]='account';
$this->import_entities_array[$r]=array(); // We define here only fields that use another icon that the one defined into import_icon
$this->import_tables_array[$r]=array('sr'=>MAIN_DB_PREFIX.'societe_rib');
$this->import_fields_array[$r]=array('sr.fk_soc'=>"ThirdPartyName*",'sr.bank'=>"Bank",
'sr.code_banque'=>"BankCode*",'sr.code_guichet'=>"DeskCode*",'sr.number'=>"BankAccountNumber*",
'sr.cle_rib'=>"BankAccountNumberKey*",'sr.bic'=>"BIC",'sr.iban_prefix'=>"IBAN"
);
$this->import_convertvalue_array[$r]=array(
'sr.fk_soc'=>array('rule'=>'fetchidfromref','classfile'=>'/societe/class/societe.class.php','class'=>'Societe','method'=>'fetch','element'=>'ThirdParty')
);
$this->import_examplevalues_array[$r]=array('sr.fk_soc'=>"MyBigCompany",'sr.bank'=>"ING",
'sr.code_banque'=>"0000", 'sr.code_guichet'=>"1111",'sr.number'=>"3333333333",
'sr.cle_rib'=>"22",'sr.bic'=>"USHINGMMXXX",'sr.iban_prefix'=>"US00 0000 1111 22 3333 3333"
);
}

View File

@ -34,11 +34,11 @@ if (empty($conf->global->EXTERNALSITE_URL))
llxFooter();
}
$mainmenu=GETPOST('mainmenu');
$leftmenu=GETPOST('leftmenu');
$idmenu=GETPOST('idmenu');
$theme=GETPOST('theme');
$codelang=GETPOST('lang');
$mainmenu=GETPOST('mainmenu', 'alpha');
$leftmenu=GETPOST('leftmenu', 'alpha');
$idmenu=GETPOST('idmenu', 'int');
$theme=GETPOST('theme', 'alpha');
$codelang=GETPOST('lang', 'alpha');
print "
<html>

View File

@ -188,7 +188,11 @@ elseif ($action == 'setdate_lim_reglement' && $user->rights->fournisseur->factur
{
$object->fetch($id);
$object->date_echeance=dol_mktime(12,0,0,$_POST['date_lim_reglementmonth'],$_POST['date_lim_reglementday'],$_POST['date_lim_reglementyear']);
if ($object->date_echeance < $object->date) $object->date_echeance=$object->date;
if ($object->date_echeance < $object->date)
{
$object->date_echeance=$object->date;
setEventMessage($langs->trans("DatePaymentTermCantBeLowerThanObjectDate"),'warnings');
}
$result=$object->update($user);
if ($result < 0) dol_print_error($db,$object->error);
}

View File

@ -30,7 +30,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
// If not defined, we select menu "home"
if (! isset($_GET["mainmenu"])) $_GET["mainmenu"]="home";
$_GET['mainmenu']=GETPOST('mainmenu', 'alpha')?GETPOST('mainmenu', 'alpha'):'home';
$action=GETPOST('action');

View File

@ -765,6 +765,7 @@ ALTER TABLE llx_commande_fournisseurdet ADD COLUMN import_key varchar(14) AFTER
ALTER TABLE llx_entrepot ADD COLUMN import_key varchar(14) AFTER fk_user_author;
ALTER TABLE llx_product_fournisseur_price ADD COLUMN import_key varchar(14) AFTER fk_user;
ALTER TABLE llx_product_stock ADD COLUMN import_key varchar(14) AFTER pmp;
ALTER TABLE llx_societe_rib ADD COLUMN import_key varchar(14) AFTER adresse_proprio;
-- [ task #146 ] Remove table llx_categorie_association
ALTER TABLE llx_categorie_association DROP FOREIGN KEY fk_categorie_asso_fk_categorie_mere;

View File

@ -1,6 +1,7 @@
-- =============================================================================
-- Copyright (C) 2000-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- Copyright (C) 2005-2009 Regis Houssin <regis@dolibarr.fr>
-- Copyright (C) 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
@ -33,7 +34,8 @@ create table llx_societe_rib
iban_prefix varchar(34), -- 34 according to ISO 13616
domiciliation varchar(255),
proprio varchar(60),
adresse_proprio varchar(255)
adresse_proprio varchar(255),
import_key varchar(14) -- import key
)ENGINE=innodb;

View File

@ -342,6 +342,7 @@ ExportDataset_company_1=Tercers (empreses/institucions) i atributs
ExportDataset_company_2=Contactes de tercers i atributs
ImportDataset_company_1=Tercers (empreses/institucions) i atributs
ImportDataset_company_2=Contactes (tercers o lliures) i atributs
ImportDataset_company_3=Comptes bancaris
PriceLevel=Nivell de preus
DeliveriesAddress=Adreça(es) d'enviament
DeliveryAddress=Adreça d'enviament

View File

@ -119,4 +119,8 @@ ExportFieldAutomaticallyAdded=S'ha afegit automàticament el camp <b>%s</b>, ja
CsvOptions=Opcions de l'arxiu CSV
Separator=Separador
Enclosure=Delimitador de camps
SuppliersProducts=Productes de proveïdors
SuppliersProducts=Productes de proveïdors
BankCode=Codi banc
DeskCode=Codi oficina
BankAccountNumber=Número compte
BankAccountNumberKey=Dígit Control

View File

@ -359,6 +359,7 @@ ExportDataset_company_1=Third parties (Companies/foundations) and properties
ExportDataset_company_2=Contacts and properties
ImportDataset_company_1=Third parties (Companies/foundations) and properties
ImportDataset_company_2=Contacts (of thirdparties or not) and attributes
ImportDataset_company_3=Bank details
PriceLevel=Price level
DeliveriesAddress=Delivery addresses
DeliveryAddress=Delivery address

View File

@ -119,4 +119,8 @@ ExportFieldAutomaticallyAdded=Field <b>%s</b> was automatically added. It will a
CsvOptions=Csv Options
Separator=Separator
Enclosure=Enclosure
SuppliersProducts=Suppliers Products
SuppliersProducts=Suppliers Products
BankCode=Bank code
DeskCode=Desk code
BankAccountNumber=Account number
BankAccountNumberKey=Key

View File

@ -343,6 +343,7 @@ ExportDataset_company_1=Terceros (empresas/instituciones) y atributos
ExportDataset_company_2=Contactos de terceros y atributos
ImportDataset_company_1=Terceros (empresas/instituciones) y atributos
ImportDataset_company_2=Contactos (terceros o libres) y atributos
ImportDataset_company_3=Cuentas bancarias
PriceLevel=Nivel de precios
DeliveriesAddress=Dirección(es) de envío
DeliveryAddress=Dirección de envío

View File

@ -119,4 +119,8 @@ ExportFieldAutomaticallyAdded=Se ha añadido automáticamente el campo <b>%s</b>
CsvOptions=Opciones del archivo CSV
Separator=Separador
Enclosure=Delimitador de campos
SuppliersProducts=Productos de proveedores
SuppliersProducts=Productos de proveedores
BankCode=Código banco
DeskCode=Código oficina
BankAccountNumber=Número cuenta
BankAccountNumberKey=Dígito Control

View File

@ -360,6 +360,7 @@ ExportDataset_company_1=Tiers (sociétés/institutions) et attributs
ExportDataset_company_2=Contacts (de tiers) et attributs
ImportDataset_company_1=Tiers (sociétés/institutions) et attributs
ImportDataset_company_2=Contacts (de tiers ou libre) et attributs
ImportDataset_company_3=Coordonnées bancaires
PriceLevel=Niveau de prix
DeliveriesAddress=Adresse(s) de livraison
DeliveryAddress=Adresse de livraison

View File

@ -119,4 +119,8 @@ ExportFieldAutomaticallyAdded=Le champ <b>%s</b> a été ajouté automatiquement
CsvOptions=Options du fichier Csv
Separator=Séparateur de champs
Enclosure=Encadrement des chaines de textes
SuppliersProducts=Produits Fournisseurs
SuppliersProducts=Produits Fournisseurs
BankCode=Code banque
DeskCode=Code guichet
BankAccountNumber=Numéro compte
BankAccountNumberKey=Clé RIB

View File

@ -279,37 +279,3 @@ PDFOursinDescription=Factuurmodel oursin
# tourteau PDF Model
PDFTourteauDescription=Factuurmodel Tourteau
# NumRef Modules
# deneb
DenebNumRefModelDesc1=Geeft het nummer in de vorm, PREF-31-12-2004-01, waar pref het voorvoegsel is , gevolgd door de datum (31 december 2004) en een teller.
DenebNumRefModelDesc2=Indien de constante FACTURE_DENEB_DELTA is gedefiniëerd, een compensatie wordt toegepast op de meter
# mars
MarsNumRefModelDesc1=Numéro de facture sous la forme, PREF-10-2004-005, qui correspond à la 5ème facture d'octobre 2004 et où PREF est le préfix de la société.
MarsNumRefModelDesc2=Le nombre final est formaté sur 3 chiffres ou plus.
MarsNumRefModelDesc3=Si la constante FACTURE_MARS_DELTA est définie, un offset est appliqué sur le compteur
# neptune
NeptuneNumRefModelDesc1=Renvoie le numéro de facture sous une forme du préfix FA suivi de l'année sur 2 chiffres et d'un compteur simple sur 4 chiffres.
NeptuneNumRefModelDesc2=Si la constante FACTURE_NEPTUNE_DELTA est définie, un offset est appliqué sur le compteur
# orion
OrionNumRefModelDesc1=Return the number under the format FAYYNNNNN where YY is the year and NNNNN the increment number starting at 1.
OrionNumRefModelDesc2=The year is increased by 1 WITHOUT an initialisation to zero at the start of the fiscal year.
OrionNumRefModelDesc3=Define the variable SOCIETE_FISCAL_MONTH_START with the month at the start of the fiscal year, example: 9 for September.
OrionNumRefModelDesc4=In this example, we shall have on the 1st of September 2006 an invoice named FA700354.
# terre
TerreNumRefModelDesc1=Renvoie le numéro sous la forme %syymm-nnnn où yy est l'année, mm le mois et nnnn un compteur séquentiel sans rupture et sans remise à 0
TerreNumRefModelError=Une facture commençant par $fayymm existe en base et est incompatible avec cette numérotation. Supprimer la ou renommer la pour activer ce module.
# titan
TitanNumRefModelDesc1=Return the number with format FAYYNNNNN where YY is the year and NNNNN is the increment number starting from 1.
TitanNumRefModelDesc2=The year is incremented by 1 and the increment number is initialized to zero at the start of the fiscal year.
TitanNumRefModelDesc3=Define the variable SOCIETE_FISCAL_MONTH_START with the month at the start of the fiscal year, example: 9 for September.
TitanNumRefModelDesc4=In this example, we shall have on the 1st September 2006 an invoice named FA0700001

View File

@ -303,7 +303,7 @@ class User extends CommonObject
// les caracteristiques (module, perms et subperms) de ce droit.
$sql = "SELECT module, perms, subperms";
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
$sql.= " WHERE id = '".$rid."'";
$sql.= " WHERE id = '".$this->db->escape($rid)."'";
$sql.= " AND entity = ".$entity;
$result=$this->db->query($sql);
@ -319,21 +319,21 @@ class User extends CommonObject
}
// Where pour la liste des droits a ajouter
$whereforadd="id=".$rid;
$whereforadd="id=".$this->db->escape($rid);
// Ajout des droits induits
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
if (! empty($subperms)) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
else if (! empty($perms)) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
}
else {
// On a pas demande un droit en particulier mais une liste de droits
// sur la base d'un nom de module de de perms
// Where pour la liste des droits a ajouter
if ($allmodule) $whereforadd="module='$allmodule'";
if ($allperms) $whereforadd=" AND perms='$allperms'";
if (! empty($allmodule)) $whereforadd="module='".$this->db->escape($allmodule)."'";
if (! empty($allperms)) $whereforadd=" AND perms='".$this->db->escape($allperms)."'";
}
// Ajout des droits trouves grace au critere whereforadd
if ($whereforadd)
if (! empty($whereforadd))
{
//print "$module-$perms-$subperms";
$sql = "SELECT id";
@ -403,7 +403,7 @@ class User extends CommonObject
// les caracteristiques module, perms et subperms de ce droit.
$sql = "SELECT module, perms, subperms";
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
$sql.= " WHERE id = '".$rid."'";
$sql.= " WHERE id = '".$this->db->escape($rid)."'";
$sql.= " AND entity = ".$entity;
$result=$this->db->query($sql);
@ -419,7 +419,7 @@ class User extends CommonObject
}
// Where pour la liste des droits a supprimer
$wherefordel="id=".$rid;
$wherefordel="id=".$this->db->escape($rid);
// Suppression des droits induits
if ($subperms=='lire' || $subperms=='read') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
if ($perms=='lire' || $perms=='read') $wherefordel.=" OR (module='$module')";
@ -427,12 +427,12 @@ class User extends CommonObject
else {
// On a demande suppression d'un droit sur la base d'un nom de module ou perms
// Where pour la liste des droits a supprimer
if ($allmodule) $wherefordel="module='$allmodule'";
if ($allperms) $wherefordel=" AND perms='$allperms'";
if (! empty($allmodule)) $wherefordel="module='".$this->db->escape($allmodule)."'";
if (! empty($allperms)) $wherefordel=" AND perms='".$this->db->escape($allperms)."'";
}
// Suppression des droits selon critere defini dans wherefordel
if ($wherefordel)
if (! empty($wherefordel))
{
//print "$module-$perms-$subperms";
$sql = "SELECT id";

View File

@ -239,13 +239,13 @@ class UserGroup extends CommonObject
$this->db->begin();
if ($rid)
if (! empty($rid))
{
// Si on a demande ajout d'un droit en particulier, on recupere
// les caracteristiques (module, perms et subperms) de ce droit.
$sql = "SELECT module, perms, subperms";
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
$sql.= " WHERE id = '".$rid."'";
$sql.= " WHERE id = '".$this->db->escape($rid)."'";
$sql.= " AND entity = ".$conf->entity;
$result=$this->db->query($sql);
@ -261,7 +261,7 @@ class UserGroup extends CommonObject
}
// Where pour la liste des droits a ajouter
$whereforadd="id=".$rid;
$whereforadd="id=".$this->db->escape($rid);
// Ajout des droits induits
if ($subperms) $whereforadd.=" OR (module='$module' AND perms='$perms' AND (subperms='lire' OR subperms='read'))";
else if ($perms) $whereforadd.=" OR (module='$module' AND (perms='lire' OR perms='read') AND subperms IS NULL)";
@ -272,12 +272,12 @@ class UserGroup extends CommonObject
}
else {
// Where pour la liste des droits a ajouter
if ($allmodule) $whereforadd="module='$allmodule'";
if ($allperms) $whereforadd=" AND perms='$allperms'";
if (! empty($allmodule)) $whereforadd="module='".$this->db->escape($allmodule)."'";
if (! empty($allperms)) $whereforadd=" AND perms='".$this->db->escape($allperms)."'";
}
// Ajout des droits de la liste whereforadd
if ($whereforadd)
if (! empty($whereforadd))
{
//print "$module-$perms-$subperms";
$sql = "SELECT id";
@ -339,13 +339,13 @@ class UserGroup extends CommonObject
$this->db->begin();
if ($rid)
if (! empty($rid))
{
// Si on a demande supression d'un droit en particulier, on recupere
// les caracteristiques module, perms et subperms de ce droit.
$sql = "SELECT module, perms, subperms";
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def";
$sql.= " WHERE id = '".$rid."'";
$sql.= " WHERE id = '".$this->db->escape($rid)."'";
$sql.= " AND entity = ".$conf->entity;
$result=$this->db->query($sql);
@ -361,7 +361,7 @@ class UserGroup extends CommonObject
}
// Where pour la liste des droits a supprimer
$wherefordel="id=".$rid;
$wherefordel="id=".$this->db->escape($rid);
// Suppression des droits induits
if ($subperms=='lire' || $subperms=='read') $wherefordel.=" OR (module='$module' AND perms='$perms' AND subperms IS NOT NULL)";
if ($perms=='lire' || $perms=='read') $wherefordel.=" OR (module='$module')";
@ -372,12 +372,12 @@ class UserGroup extends CommonObject
}
else {
// Where pour la liste des droits a supprimer
if ($allmodule) $wherefordel="module='$allmodule'";
if ($allperms) $wherefordel=" AND perms='$allperms'";
if (! empty($allmodule)) $wherefordel="module='".$this->db->escape($allmodule)."'";
if (! empty($allperms)) $wherefordel=" AND perms='".$this->db->escape($allperms)."'";
}
// Suppression des droits de la liste wherefordel
if ($wherefordel)
if (! empty($wherefordel))
{
//print "$module-$perms-$subperms";
$sql = "SELECT id";

View File

@ -33,9 +33,10 @@ $langs->load("users");
$langs->load("admin");
$id=GETPOST('id','int');
$action=GETPOST("action");
$confirm=GETPOST("confirm");
$module=GETPOST("module");
$action=GETPOST('action', 'alpha');
$confirm=GETPOST('confirm', 'alpha');
$module=GETPOST('module', 'alpha');
$rights=GETPOST('rights', 'int');
// Defini si peux lire les permissions
$canreadperms=($user->admin || $user->rights->user->user->lire);
@ -60,14 +61,14 @@ if ($action == 'addrights' && $caneditperms)
{
$editgroup = new Usergroup($db);
$result=$editgroup->fetch($id);
if ($result > 0) $editgroup->addrights($_GET["rights"],$module);
if ($result > 0) $editgroup->addrights($rights, $module);
}
if ($action == 'delrights' && $caneditperms)
{
$editgroup = new Usergroup($db);
$result=$editgroup->fetch($id);
if ($result > 0) $editgroup->delrights($_GET["rights"],$module);
if ($result > 0) $editgroup->delrights($rights, $module);
}

View File

@ -35,8 +35,8 @@ $langs->load("admin");
$id=GETPOST('id', 'int');
$action=GETPOST('action', 'alpha');
$confirm=GETPOST('confirm', 'alpha');
$rights=GETPOST('rights','int');
$module=GETPOST('module');
$module=GETPOST('module', 'alpha');
$rights=GETPOST('rights', 'int');
$entity=(GETPOST('entity','int')?GETPOST('entity','int'):$conf->entity);
if (! isset($id) || empty($id)) accessforbidden();