Merge remote-tracking branch 'origin/3.5' into develop

Conflicts:
	htdocs/fourn/commande/fiche.php
	htdocs/langs/es_ES/admin.lang
	htdocs/langs/es_ES/languages.lang
	htdocs/langs/es_ES/main.lang
This commit is contained in:
Laurent Destailleur 2013-12-19 21:03:15 +01:00
commit 9e5e74cb58
8 changed files with 40 additions and 29 deletions

View File

@ -2056,7 +2056,7 @@ class Propal extends CommonObject
{ {
// We remove directory // We remove directory
$ref = dol_sanitizeFileName($this->ref); $ref = dol_sanitizeFileName($this->ref);
if ($conf->propal->dir_output) if ($conf->propal->dir_output && !empty($this->ref))
{ {
$dir = $conf->propal->dir_output . "/" . $ref ; $dir = $conf->propal->dir_output . "/" . $ref ;
$file = $dir . "/" . $ref . ".pdf"; $file = $dir . "/" . $ref . ".pdf";

View File

@ -2457,7 +2457,7 @@ class Commande extends CommonOrder
// On efface le repertoire de pdf provisoire // On efface le repertoire de pdf provisoire
$comref = dol_sanitizeFileName($this->ref); $comref = dol_sanitizeFileName($this->ref);
if ($conf->commande->dir_output) if ($conf->commande->dir_output && !empty($this->ref))
{ {
$dir = $conf->commande->dir_output . "/" . $comref ; $dir = $conf->commande->dir_output . "/" . $comref ;
$file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf"; $file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf";

View File

@ -1323,7 +1323,7 @@ class Facture extends CommonInvoice
{ {
// On efface le repertoire de pdf provisoire // On efface le repertoire de pdf provisoire
$ref = dol_sanitizeFileName($this->ref); $ref = dol_sanitizeFileName($this->ref);
if ($conf->facture->dir_output) if ($conf->facture->dir_output && !empty($this->ref))
{ {
$dir = $conf->facture->dir_output . "/" . $ref; $dir = $conf->facture->dir_output . "/" . $ref;
$file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf"; $file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";

View File

@ -49,8 +49,12 @@ function tax_prepare_head($object)
// $this->tabs = array('entity:-tabname); to remove a tab // $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf,$langs,$object,$head,$h,'tax'); complete_head_from_modules($conf,$langs,$object,$head,$h,'tax');
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$upload_dir = $conf->tax->dir_output . "/" . dol_sanitizeFileName($object->ref);
$nbFiles = count(dol_dir_list($upload_dir,'files'));
$head[$h][0] = DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/compta/sociales/document.php?id='.$object->id;
$head[$h][1] = $langs->trans("Documents"); $head[$h][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
$head[$h][2] = 'documents'; $head[$h][2] = 'documents';
$h++; $h++;

View File

@ -168,6 +168,15 @@ function check_user_password_ldap($usertotest,$passwordtotest,$entitytotest)
{ {
dol_syslog("functions_ldap::check_user_password_ldap Sync user found id=".$user->id); 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 ($conf->multicompany->enabled) {
global $mc;
$ret=$mc->checkRight($user->id, $entitytotest);
if ($ret < 0) $login=false; // provoque l'echec de l'identification
}
if ($user->login != $ldap->login && $ldap->login) if ($user->login != $ldap->login && $ldap->login)
{ {
$user->login = $ldap->login; $user->login = $ldap->login;

View File

@ -701,38 +701,37 @@ elseif ($action == 'update_extras')
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element); $extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
if($ret < 0) if($ret < 0) $error++;
$error++;
if (!$error)
if(!$error) { {
// Actions on extra fields (by external module or standard code) // Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !! // FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('supplierorderdao')); $hookmanager->initHooks(array('supplierorderdao'));
$parameters=array('id'=>$object->id); $parameters=array('id'=>$object->id);
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
if (empty($reshook)) if (empty($reshook))
{ {
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{ {
$result=$object->insertExtraFields(); $result=$object->insertExtraFields();
if ($result < 0) if ($result < 0)
{ {
$error++; $error++;
} }
} }
} }
else if ($reshook < 0) $error++; else if ($reshook < 0) $error++;
} }
else else
{ {
$action = 'edit_extras'; $action = 'edit_extras';
} }
} }
@ -1119,12 +1118,12 @@ if ($action=="create")
// Other options // Other options
$parameters=array(); $parameters=array();
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $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)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
print $object->showOptionals($extrafields,'edit'); print $object->showOptionals($extrafields,'edit');
} }
// Bouton "Create Draft" // Bouton "Create Draft"
print "</table>\n"; print "</table>\n";
@ -1141,9 +1140,9 @@ elseif (! empty($object->id))
$title=$langs->trans("SupplierOrder"); $title=$langs->trans("SupplierOrder");
dol_fiche_head($head, 'card', $title, 0, 'order'); dol_fiche_head($head, 'card', $title, 0, 'order');
$res=$object->fetch_optionals($object->id,$extralabels); $res=$object->fetch_optionals($object->id,$extralabels);
/* /*
* Confirmation de la suppression de la commande * Confirmation de la suppression de la commande
*/ */
@ -1408,7 +1407,6 @@ elseif (! empty($object->id))
// Other attributes // Other attributes
$parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"'); $parameters=array('socid'=>$socid, 'colspan' => ' colspan="3"');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook $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)) if (empty($reshook) && ! empty($extrafields->attribute_label))
{ {
if ($action == 'edit_extras') if ($action == 'edit_extras')
@ -1418,7 +1416,7 @@ elseif (! empty($object->id))
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">'; print '<input type="hidden" name="id" value="'.$object->id.'">';
} }
foreach($extrafields->attribute_label as $key=>$label) foreach($extrafields->attribute_label as $key=>$label)
{ {
if ($action == 'edit_extras') { if ($action == 'edit_extras') {
@ -1426,7 +1424,7 @@ elseif (! empty($object->id))
} else { } else {
$value=$object->array_options["options_".$key]; $value=$object->array_options["options_".$key];
} }
if ($extrafields->attribute_type[$key] == 'separate') if ($extrafields->attribute_type[$key] == 'separate')
{ {
print $extrafields->showSeparator($key); print $extrafields->showSeparator($key);
@ -1441,7 +1439,7 @@ elseif (! empty($object->id))
{ {
$value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]); $value = isset($_POST["options_".$key])?dol_mktime($_POST["options_".$key."hour"], $_POST["options_".$key."min"], 0, $_POST["options_".$key."month"], $_POST["options_".$key."day"], $_POST["options_".$key."year"]):$db->jdate($object->array_options['options_'.$key]);
} }
if ($action == 'edit_extras' && $user->rights->fournisseur->commande->creer) if ($action == 'edit_extras' && $user->rights->fournisseur->commande->creer)
{ {
print $extrafields->showInputField($key,$value); print $extrafields->showInputField($key,$value);
@ -1450,12 +1448,13 @@ elseif (! empty($object->id))
{ {
print $extrafields->showOutputField($key,$value); print $extrafields->showOutputField($key,$value);
} }
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
} }
if(count($extrafields->attribute_label) > 0) { if(count($extrafields->attribute_label) > 0)
{
if ($action == 'edit_extras' && $user->rights->fournisseur->commande->creer) if ($action == 'edit_extras' && $user->rights->fournisseur->commande->creer)
{ {
print '<tr><td></td><td colspan="5">'; print '<tr><td></td><td colspan="5">';
@ -1463,7 +1462,8 @@ elseif (! empty($object->id))
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
} }
else { else
{
if ($object->statut == 0 && $user->rights->fournisseur->commande->creer) if ($object->statut == 0 && $user->rights->fournisseur->commande->creer)
{ {
print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>'; print '<tr><td></td><td><a href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=edit_extras">'.img_picto('','edit').' '.$langs->trans('Modify').'</a></td></tr>';
@ -1471,7 +1471,7 @@ elseif (! empty($object->id))
} }
} }
} }
// Ligne de 3 colonnes // Ligne de 3 colonnes
print '<tr><td>'.$langs->trans("AmountHT").'</td>'; print '<tr><td>'.$langs->trans("AmountHT").'</td>';
print '<td align="right"><b>'.price($object->total_ht).'</b></td>'; print '<td align="right"><b>'.price($object->total_ht).'</b></td>';

View File

@ -1010,7 +1010,6 @@ AddRefInList=Mostrar el código de cliente/proveedor en los listados (lista desp
FieldEdition=Edición del campo %s FieldEdition=Edición del campo %s
FixTZ=Ajueste TimeZone FixTZ=Ajueste TimeZone
FillThisOnlyIfRequired=Ejemplo: +2 (Rellene únicamente si se experimentan problemas de offset de zona horaria) FillThisOnlyIfRequired=Ejemplo: +2 (Rellene únicamente si se experimentan problemas de offset de zona horaria)
##### Module password generation ##### Module password generation
PasswordGenerationStandard=Devuelve una contraseña generada por el algoritmo interno Dolibarr: 8 caracteres, números y caracteres en minúsculas mezcladas. PasswordGenerationStandard=Devuelve una contraseña generada por el algoritmo interno Dolibarr: 8 caracteres, números y caracteres en minúsculas mezcladas.
PasswordGenerationNone=No ofrece contraseñas. La contraseña se introduce manualmente. PasswordGenerationNone=No ofrece contraseñas. La contraseña se introduce manualmente.

View File

@ -666,7 +666,6 @@ SaveUploadedFileWithMask=Guardar el archivo con el nombre "<strong>%s</strong>"
OriginFileName=Nombre del archivo origen OriginFileName=Nombre del archivo origen
SetDemandReason=Definir origen SetDemandReason=Definir origen
ViewPrivateNote=Ver notas ViewPrivateNote=Ver notas
# Week day # Week day
Monday=Lunes Monday=Lunes
Tuesday=Martes Tuesday=Martes