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

This commit is contained in:
Laurent Destailleur 2013-02-10 21:56:44 +01:00
commit 49f40ee429
15 changed files with 1059 additions and 718 deletions

View File

@ -265,8 +265,6 @@ $head[$h][2] = 'marketplace';
$h++; $h++;
// Show warning about external users
print showModulesExludedForExternal($modules).'<br>'."\n";
print "<br>\n"; print "<br>\n";
@ -500,6 +498,10 @@ else
dol_fiche_end(); dol_fiche_end();
// Show warning about external users
print showModulesExludedForExternal($modules).'<br>'."\n";
llxFooter(); llxFooter();
$db->close(); $db->close();

View File

@ -742,7 +742,7 @@ if ($id > 0)
if (! empty($conf->propal->enabled) && $user->rights->propal->creer) if (! empty($conf->propal->enabled) && $user->rights->propal->creer)
{ {
$langs->load("propal"); $langs->load("propal");
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>';
} }
if (! empty($conf->commande->enabled) && $user->rights->commande->creer) if (! empty($conf->commande->enabled) && $user->rights->commande->creer)

View File

@ -5,7 +5,7 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com> * Copyright (C) 2010-2011 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr> * Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* *
@ -38,7 +38,11 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php'; require_once DOL_DOCUMENT_ROOT.'/core/modules/propale/modules_propale.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/propal.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
if (! empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; if (! empty($conf->projet->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
}
$langs->load('companies'); $langs->load('companies');
$langs->load('propal'); $langs->load('propal');
@ -46,6 +50,7 @@ $langs->load('compta');
$langs->load('bills'); $langs->load('bills');
$langs->load('orders'); $langs->load('orders');
$langs->load('products'); $langs->load('products');
$langs->load("deliveries");
if (! empty($conf->margin->enabled)) if (! empty($conf->margin->enabled))
$langs->load('margins'); $langs->load('margins');
@ -55,6 +60,8 @@ $id=GETPOST('id','int');
$ref=GETPOST('ref','alpha'); $ref=GETPOST('ref','alpha');
$socid=GETPOST('socid','int'); $socid=GETPOST('socid','int');
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
$origin=GETPOST('origin','alpha');
$originid=GETPOST('originid','int');
$confirm=GETPOST('confirm','alpha'); $confirm=GETPOST('confirm','alpha');
$lineid=GETPOST('lineid','int'); $lineid=GETPOST('lineid','int');
@ -72,30 +79,12 @@ $result = restrictedArea($user, 'propal', $id);
$object = new Propal($db); $object = new Propal($db);
// Load object
// Load object // Load object
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{
if ($action != 'add')
{ {
$ret=$object->fetch($id, $ref); $ret=$object->fetch($id, $ref);
if ($ret == 0) $ret=$object->fetch_thirdparty();
{
$langs->load("errors");
setEventMessage($langs->trans('ErrorRecordNotFound'), 'errors');
$error++;
}
else if ($ret < 0)
{
setEventMessage($object->error, 'errors');
$error++;
}
else $object->fetch_thirdparty();
}
}
else
{
header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php');
exit;
} }
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
@ -262,14 +251,21 @@ else if ($action == 'add' && $user->rights->propal->creer)
if (empty($datep)) if (empty($datep))
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")), 'errors');
header("Location: ".DOL_URL_ROOT.'/comm/addpropal.php?socid='.$socid.'&action=create'); $action='create';
exit; $error++;
} }
if (empty($duration)) if (empty($duration))
{ {
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors'); setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("ValidityDuration")), 'errors');
header("Location: ".DOL_URL_ROOT.'/comm/addpropal.php?socid='.$socid.'&action=create'); $action='create';
exit; $error++;
}
if ($socid<1)
{
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Customer")),'errors');
$action='create';
$error++;
} }
if (! $error) if (! $error)
@ -1174,6 +1170,297 @@ $companystatic=new Societe($db);
$now=dol_now(); $now=dol_now();
// Add new proposal
if ($action == 'create')
{
print_fiche_titre($langs->trans("NewProp"));
$soc = new Societe($db);
if ($socid>0) $res=$soc->fetch($socid);
$object = new Propal($db);
$numpr='';
$obj = $conf->global->PROPALE_ADDON;
if ($obj)
{
if (! empty($conf->global->PROPALE_ADDON) && is_readable(DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.".php"))
{
require_once DOL_DOCUMENT_ROOT ."/core/modules/propale/".$conf->global->PROPALE_ADDON.'.php';
$modPropale = new $obj;
$numpr = $modPropale->getNextValue($soc,$object);
}
}
// Fix pour modele numerotation qui deconne
// Si numero deja pris (ne devrait pas arriver), on incremente par .num+1
$sql = "SELECT count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."propal";
$sql.= " WHERE ref LIKE '".$numpr."%'";
$sql.= " AND entity = ".$conf->entity;
$resql=$db->query($sql);
if ($resql)
{
$obj=$db->fetch_object($resql);
$num = $obj->nb;
$db->free($resql);
if ($num > 0)
{
$numpr .= "." . ($num + 1);
}
}
print '<form name="addprop" action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="add">';
if ($origin != 'project' && $originid)
{
print '<input type="hidden" name="origin" value="'.$origin.'">';
print '<input type="hidden" name="originid" value="'.$originid.'">';
}
print '<table class="border" width="100%">';
// Ref
print '<tr><td class="fieldrequired">'.$langs->trans("Ref").'</td>';
print '<td colspan="2">'.$numpr.'</td>';
print '<input type="hidden" name="ref" value="'.$numpr.'">';
print '</tr>';
// Ref customer
print '<tr><td>'.$langs->trans('RefCustomer').'</td><td colspan="2">';
print '<input type="text" name="ref_client" value=""></td>';
print '</tr>';
// Third party
print '<tr>';
print '<td class="fieldrequired">'.$langs->trans('Customer').'</td>';
if($socid>0)
{
print '<td colspan="2">';
print $soc->getNomUrl(1);
print '<input type="hidden" name="socid" value="'.$soc->id.'">';
print '</td>';
}
else
{
print '<td colspan="2">';
print $form->select_company('','socid','s.client = 1',1);
print '</td>';
}
print '</tr>'."\n";
// Contacts
if($socid>0)
{
print "<tr><td>".$langs->trans("DefaultContact").'</td><td colspan="2">';
$form->select_contacts($soc->id,$setcontact,'contactidp',1,$srccontactslist);
print '</td></tr>';
// Ligne info remises tiers
print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="2">';
if ($soc->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$soc->remise_client);
else print $langs->trans("CompanyHasNoRelativeDiscount");
$absolute_discount=$soc->getAvailableDiscounts();
print '. ';
if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->currency));
else print $langs->trans("CompanyHasNoAbsoluteDiscount");
print '.';
print '</td></tr>';
}
// Date
print '<tr><td class="fieldrequired">'.$langs->trans('Date').'</td><td colspan="2">';
$form->select_date('','','','','',"addprop");
print '</td></tr>';
// Validaty duration
print '<tr><td class="fieldrequired">'.$langs->trans("ValidityDuration").'</td><td colspan="2"><input name="duree_validite" size="5" value="'.$conf->global->PROPALE_VALIDITY_DURATION.'"> '.$langs->trans("days").'</td></tr>';
// Terms of payment
print '<tr><td nowrap="nowrap" class="fieldrequired">'.$langs->trans('PaymentConditionsShort').'</td><td colspan="2">';
$form->select_conditions_paiements($soc->cond_reglement,'cond_reglement_id');
print '</td></tr>';
// Mode of payment
print '<tr><td>'.$langs->trans('PaymentMode').'</td><td colspan="2">';
$form->select_types_paiements($soc->mode_reglement,'mode_reglement_id');
print '</td></tr>';
// What trigger creation
print '<tr><td>'.$langs->trans('Source').'</td><td>';
$form->select_demand_reason('','demand_reason_id',"SRC_PROP",1);
print '</td></tr>';
// Delivery delay
print '<tr><td>'.$langs->trans('AvailabilityPeriod').'</td><td colspan="2">';
$form->select_availability('','availability_id','',1);
print '</td></tr>';
// Delivery date (or manufacturing)
print '<tr><td>'.$langs->trans("DeliveryDate").'</td>';
print '<td colspan="2">';
if ($conf->global->DATE_LIVRAISON_WEEK_DELAY != "")
{
$tmpdte = time() + ((7 * $conf->global->DATE_LIVRAISON_WEEK_DELAY) * 24 * 60 * 60);
$syear = date("Y", $tmpdte);
$smonth = date("m", $tmpdte);
$sday = date("d", $tmpdte);
$form->select_date($syear."-".$smonth."-".$sday,'liv_','','','',"addprop");
}
else
{
$datepropal=empty($conf->global->MAIN_AUTOFILL_DATE)?-1:0;
$form->select_date($datepropal,'liv_','','','',"addprop");
}
print '</td></tr>';
// Model
print '<tr>';
print '<td>'.$langs->trans("DefaultModel").'</td>';
print '<td colspan="2">';
$liste=ModelePDFPropales::liste_modeles($db);
print $form->selectarray('model',$liste,$conf->global->PROPALE_ADDON_PDF);
print "</td></tr>";
// Project
if (! empty($conf->projet->enabled) && $socid>0)
{
$projectid = 0;
if ($origin == 'project') $projectid = ($originid?$originid:0);
print '<tr>';
print '<td valign="top">'.$langs->trans("Project").'</td><td colspan="2">';
$numprojet=select_projects($soc->id,$projectid);
if ($numprojet==0)
{
print ' &nbsp; <a href="../projet/fiche.php?socid='.$soc->id.'&action=create">'.$langs->trans("AddProject").'</a>';
}
print '</td>';
print '</tr>';
}
// Other attributes
$parameters=array('colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
print $extrafields->showInputField($key,$value);
print '</td></tr>'."\n";
}
}
print "</table>";
print '<br>';
/*
* Combobox pour la fonction de copie
*/
if (empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE))
{
print '<input type="hidden" name="createmode" value="empty">';
}
print '<table>';
if (! empty($conf->global->PROPAL_CLONE_ON_CREATE_PAGE))
{
// For backward compatibility
print '<tr>';
print '<td><input type="radio" name="createmode" value="copy"></td>';
print '<td>'.$langs->trans("CopyPropalFrom").' </td>';
print '<td>';
$liste_propal = array();
$liste_propal[0] = '';
$sql ="SELECT p.rowid as id, p.ref, s.nom";
$sql.=" FROM ".MAIN_DB_PREFIX."propal p";
$sql.= ", ".MAIN_DB_PREFIX."societe s";
$sql.= " WHERE s.rowid = p.fk_soc";
$sql.= " AND p.entity = ".$conf->entity;
$sql.= " AND p.fk_statut <> 0";
$sql.= " ORDER BY Id";
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num)
{
$row = $db->fetch_row($resql);
$propalRefAndSocName = $row[1]." - ".$row[2];
$liste_propal[$row[0]]=$propalRefAndSocName;
$i++;
}
print $form->selectarray("copie_propal",$liste_propal, 0);
}
else
{
dol_print_error($db);
}
print '</td></tr>';
if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE)) print '<tr><td colspan="3">&nbsp;</td></tr>';
print '<tr><td valign="top"><input type="radio" name="createmode" value="empty" checked="checked"></td>';
print '<td valign="top" colspan="2">'.$langs->trans("CreateEmptyPropal").'</td></tr>';
}
if (! empty($conf->global->PRODUCT_SHOW_WHEN_CREATE))
{
print '<tr><td colspan="3">';
if (! empty($conf->product->enabled) || ! empty($conf->service->enabled))
{
$lib=$langs->trans("ProductsAndServices");
print '<table class="border" width="100%">';
print '<tr>';
print '<td>'.$lib.'</td>';
print '<td>'.$langs->trans("Qty").'</td>';
print '<td>'.$langs->trans("ReductionShort").'</td>';
print '</tr>';
for ($i = 1 ; $i <= $conf->global->PRODUCT_SHOW_WHEN_CREATE; $i++)
{
print '<tr><td>';
// multiprix
if($conf->global->PRODUIT_MULTIPRICES && $soc->price_level)
$form->select_produits('',"idprod".$i,'',$conf->product->limit_size,$soc->price_level);
else
$form->select_produits('',"idprod".$i,'',$conf->product->limit_size);
print '</td>';
print '<td><input type="text" size="2" name="qty'.$i.'" value="1"></td>';
print '<td><input type="text" size="2" name="remise'.$i.'" value="'.$soc->remise_client.'">%</td>';
print '</tr>';
}
print "</table>";
}
print '</td></tr>';
}
print '</table>';
print '<br>';
$langs->load("bills");
print '<center>';
print '<input type="submit" class="button" value="'.$langs->trans("CreateDraft").'">';
print '&nbsp;<input type="button" class="button" value="'.$langs->trans("Cancel").'" onClick="javascript:history.go(-1)">';
print '</center>';
print "</form>";
}
else
{
/* /*
* Show object in view mode * Show object in view mode
*/ */
@ -1897,7 +2184,7 @@ if ($action == 'presend')
print '<br>'; print '<br>';
} }
}
// End of page // End of page
llxFooter(); llxFooter();

View File

@ -296,7 +296,7 @@ if ($socid > 0)
if (! empty($conf->propal->enabled) && $user->rights->propale->creer) if (! empty($conf->propal->enabled) && $user->rights->propale->creer)
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$object->id.'&amp;action=create">'.$langs->trans("AddProp").'</a>';
} }
// Add action // Add action

View File

@ -264,6 +264,7 @@ function dol_mimetype($file,$default='application/octet-stream',$mode=0)
if (preg_match('/\.(h)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='h'; } if (preg_match('/\.(h)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='h'; }
if (preg_match('/\.(java|jsp)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='java'; } if (preg_match('/\.(java|jsp)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='java'; }
if (preg_match('/\.php([0-9]{1})?$/i',$tmpfile)) { $mime='text/plain'; $imgmime='php.png'; $srclang='php'; } if (preg_match('/\.php([0-9]{1})?$/i',$tmpfile)) { $mime='text/plain'; $imgmime='php.png'; $srclang='php'; }
if (preg_match('/\.phtml$/i',$tmpfile)) { $mime='text/plain'; $imgmime='php.png'; $srclang='php'; }
if (preg_match('/\.(pl|pm)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='pl.png'; $srclang='perl'; } if (preg_match('/\.(pl|pm)$/i',$tmpfile)) { $mime='text/plain'; $imgmime='pl.png'; $srclang='perl'; }
if (preg_match('/\.sql$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='sql'; } if (preg_match('/\.sql$/i',$tmpfile)) { $mime='text/plain'; $imgmime='text.png'; $srclang='sql'; }
if (preg_match('/\.js$/i',$tmpfile)) { $mime='text/x-javascript'; $imgmime='jscript.png'; $srclang='js'; } if (preg_match('/\.js$/i',$tmpfile)) { $mime='text/x-javascript'; $imgmime='jscript.png'; $srclang='js'; }

View File

@ -148,6 +148,8 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
// ldap2dolibarr synchronisation // ldap2dolibarr synchronisation
if ($login && ! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr') if ($login && ! empty($conf->ldap->enabled) && $conf->global->LDAP_SYNCHRO_ACTIVE == 'ldap2dolibarr')
{ {
dol_syslog("functions_ldap::check_user_password_ldap Sync ldap2dolibarr");
// On charge les attributs du user ldap // On charge les attributs du user ldap
if ($ldapdebug) print "DEBUG: login ldap = ".$login."<br>\n"; if ($ldapdebug) print "DEBUG: login ldap = ".$login."<br>\n";
$resultFetchLdapUser = $ldap->fetch($login,$userSearchFilter); $resultFetchLdapUser = $ldap->fetch($login,$userSearchFilter);
@ -164,6 +166,7 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
$resultFetchUser=$user->fetch('',$login,$sid); $resultFetchUser=$user->fetch('',$login,$sid);
if ($resultFetchUser > 0) if ($resultFetchUser > 0)
{ {
dol_syslog("functions_ldap::check_user_password_ldap Sync user found id=".$user->id);
// On verifie si le login a change et on met a jour les attributs dolibarr // On verifie si le login a change et on met a jour les attributs dolibarr
if ($user->login != $ldap->login && $ldap->login) if ($user->login != $ldap->login && $ldap->login)
{ {
@ -171,7 +174,8 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
$user->update($user); $user->update($user);
// TODO Que faire si update echoue car on update avec un login deja existant. // TODO Que faire si update echoue car on update avec un login deja existant.
} }
//$resultUpdate = $user->update_ldap2dolibarr();
//$resultUpdate = $user->update_ldap2dolibarr($ldap);
} }
} }
} }

View File

@ -836,7 +836,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after)
{ {
$langs->load("propal"); $langs->load("propal");
$newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Prop"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals'); $newmenu->add("/comm/propal/index.php?leftmenu=propals", $langs->trans("Prop"), 0, $user->rights->propale->lire, '', $mainmenu, 'propals');
$newmenu->add("/societe/societe.php?leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer); $newmenu->add("/comm/propal.php?action=create&amp;leftmenu=propals", $langs->trans("NewPropal"), 1, $user->rights->propale->creer);
$newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire); $newmenu->add("/comm/propal/list.php?leftmenu=propals", $langs->trans("List"), 1, $user->rights->propale->lire);
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire); if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=0", $langs->trans("PropalsDraft"), 2, $user->rights->propale->lire);
if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire); if ($leftmenu=="propals") $newmenu->add("/comm/propal/list.php?leftmenu=propals&viewstatut=1", $langs->trans("PropalsOpened"), 2, $user->rights->propale->lire);

View File

@ -91,3 +91,7 @@ CatSupList=Llista de categories de proveïdors
CatCusList=Llista de categories de clients/potencials CatCusList=Llista de categories de clients/potencials
CatProdList=Llista de categories de productes CatProdList=Llista de categories de productes
CatMemberList=Llista de categories de membres CatMemberList=Llista de categories de membres
# Imports
CatProdLinks=Productes
CatCusLinks=Clients/Clients potencials
CatSupLinks=Proveïdors

View File

@ -96,3 +96,7 @@ CatSupLinks=Links between suppliers and categories
CatCusLinks=Links between customers/prospects and categories CatCusLinks=Links between customers/prospects and categories
CatProdLinks=Links between products/services and categories CatProdLinks=Links between products/services and categories
CatMemberLinks=Links between members and categories CatMemberLinks=Links between members and categories
# Imports
CatProdLinks=Products
CatCusLinks=Customer/Prospects
CatSupLinks=Suppliers

View File

@ -91,3 +91,7 @@ CatSupList=Listado categorías de proveedores
CatCusList=Listado categorías de clientes/potenciales CatCusList=Listado categorías de clientes/potenciales
CatProdList=Listado categorías de productos CatProdList=Listado categorías de productos
CatMemberList=Listado categorías de miembros CatMemberList=Listado categorías de miembros
# Imports
CatProdLinks=Productos
CatCusLinks=Clientes/Clientes potenciales
CatSupLinks=Proveedores

View File

@ -96,3 +96,7 @@ CatSupLinks=Liens entre les fournisseurs et les catégories
CatCusLinks=Liens entre les clients/prospects et les catégories CatCusLinks=Liens entre les clients/prospects et les catégories
CatProdLinks=Liens entre les produits/services et les catégories CatProdLinks=Liens entre les produits/services et les catégories
CatMemberLinks=Links entre les adhérents et les catégories CatMemberLinks=Links entre les adhérents et les catégories
# Imports
CatProdLinks=Produits
CatCusLinks=Clients/Prospects
CatSupLinks=Fournisseurs

View File

@ -265,7 +265,7 @@ foreach ($listofreferent as $key => $value)
{ {
if ($key == 'propal' && ! empty($conf->propal->enabled) && $user->rights->propale->creer) if ($key == 'propal' && ! empty($conf->propal->enabled) && $user->rights->propale->creer)
{ {
print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/addpropal.php?socid='.$project->societe->id.'&amp;action=create&amp;origin='.$project->element.'&amp;originid='.$project->id.'">'.$langs->trans("AddProp").'</a>'; print '<a class="butAction" href="'.DOL_URL_ROOT.'/comm/propal.php?socid='.$project->societe->id.'&amp;action=create&amp;origin='.$project->element.'&amp;originid='.$project->id.'">'.$langs->trans("AddProp").'</a>';
} }
if ($key == 'order' && ! empty($conf->commande->enabled) && $user->rights->commande->creer) if ($key == 'order' && ! empty($conf->commande->enabled) && $user->rights->commande->creer)
{ {

View File

@ -2070,6 +2070,34 @@ class User extends CommonObject
} }
} }
/**
* Update user using data from the LDAP
* // TODO: Voir pourquoi le update met à jour avec toutes les valeurs vide (global $user écrase ?)
*/
function update_ldap2dolibarr(&$ldapuser) {
global $user, $conf;
$this->firstname=$ldapuser->{$conf->global->LDAP_FIELD_FIRSTNAME};
$this->lastname=$ldapuser->{$conf->global->LDAP_FIELD_NAME};
$this->login=$ldapuser->{$conf->global->LDAP_FIELD_LOGIN};
$this->pass=$ldapuser->{$conf->global->LDAP_FIELD_PASSWORD};
$this->pass_indatabase_crypted=$ldapuser->{$conf->global->LDAP_FIELD_PASSWORD_CRYPTED};
$this->office_phone=$ldapuser->{$conf->global->LDAP_FIELD_PHONE};
$this->user_mobile=$ldapuser->{$conf->global->LDAP_FIELD_MOBILE};
$this->office_fax=$ldapuser->{$conf->global->LDAP_FIELD_FAX};
$this->email=$ldapuser->{$conf->global->LDAP_FIELD_MAIL};
$this->ldap_sid=$ldapuser->{$conf->global->LDAP_FIELD_SID};
$this->job=$ldapuser->{$conf->global->LDAP_FIELD_TITLE};
$this->note=$ldapuser->{$conf->global->LDAP_FIELD_DESCRIPTION};
$result = $this->update($user);
dol_syslog(get_class($this)."::update_ldap2dolibarr result=".$result, LOG_DEBUG);
return $result;
}
} }
?> ?>

View File

@ -324,7 +324,9 @@ if ($action == 'update' && ! $_POST["cancel"])
$object->firstname = GETPOST("prenom"); $object->firstname = GETPOST("prenom");
$object->login = GETPOST("login"); $object->login = GETPOST("login");
$object->pass = GETPOST("password"); $object->pass = GETPOST("password");
if($user->admin == 1) { // A user can only be set admin by an admin
$object->admin = GETPOST("admin"); $object->admin = GETPOST("admin");
}
$object->office_phone=GETPOST("office_phone"); $object->office_phone=GETPOST("office_phone");
$object->office_fax = GETPOST("office_fax"); $object->office_fax = GETPOST("office_fax");
$object->user_mobile= GETPOST("user_mobile"); $object->user_mobile= GETPOST("user_mobile");

View File

@ -200,6 +200,7 @@ if ($result >= 0)
$fuser->user_mobile=$ldapuser[$conf->global->LDAP_FIELD_MOBILE]; $fuser->user_mobile=$ldapuser[$conf->global->LDAP_FIELD_MOBILE];
$fuser->office_fax=$ldapuser[$conf->global->LDAP_FIELD_FAX]; $fuser->office_fax=$ldapuser[$conf->global->LDAP_FIELD_FAX];
$fuser->email=$ldapuser[$conf->global->LDAP_FIELD_MAIL]; $fuser->email=$ldapuser[$conf->global->LDAP_FIELD_MAIL];
$fuser->ldap_sid=$ldapuser[$conf->global->LDAP_FIELD_SID];
$fuser->job=$ldapuser[$conf->global->LDAP_FIELD_TITLE]; $fuser->job=$ldapuser[$conf->global->LDAP_FIELD_TITLE];
$fuser->note=$ldapuser[$conf->global->LDAP_FIELD_DESCRIPTION]; $fuser->note=$ldapuser[$conf->global->LDAP_FIELD_DESCRIPTION];