Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/3.5' into develop
Browse files Browse the repository at this point in the history
Conflicts:
	htdocs/fourn/commande/fiche.php
	htdocs/langs/es_ES/admin.lang
	htdocs/langs/es_ES/languages.lang
	htdocs/langs/es_ES/main.lang
  • Loading branch information
eldy committed Dec 19, 2013
2 parents acc4850 + 4d3290e commit 9e5e74c
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 29 deletions.
2 changes: 1 addition & 1 deletion htdocs/comm/propal/class/propal.class.php
Expand Up @@ -2056,7 +2056,7 @@ function delete($user, $notrigger=0)
{
// We remove directory
$ref = dol_sanitizeFileName($this->ref);
if ($conf->propal->dir_output)
if ($conf->propal->dir_output && !empty($this->ref))
{
$dir = $conf->propal->dir_output . "/" . $ref ;
$file = $dir . "/" . $ref . ".pdf";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/commande/class/commande.class.php
Expand Up @@ -2457,7 +2457,7 @@ function delete($user, $notrigger=0)

// On efface le repertoire de pdf provisoire
$comref = dol_sanitizeFileName($this->ref);
if ($conf->commande->dir_output)
if ($conf->commande->dir_output && !empty($this->ref))
{
$dir = $conf->commande->dir_output . "/" . $comref ;
$file = $conf->commande->dir_output . "/" . $comref . "/" . $comref . ".pdf";
Expand Down
2 changes: 1 addition & 1 deletion htdocs/compta/facture/class/facture.class.php
Expand Up @@ -1323,7 +1323,7 @@ function delete($rowid=0, $notrigger=0, $idwarehouse=-1)
{
// On efface le repertoire de pdf provisoire
$ref = dol_sanitizeFileName($this->ref);
if ($conf->facture->dir_output)
if ($conf->facture->dir_output && !empty($this->ref))
{
$dir = $conf->facture->dir_output . "/" . $ref;
$file = $conf->facture->dir_output . "/" . $ref . "/" . $ref . ".pdf";
Expand Down
4 changes: 4 additions & 0 deletions htdocs/core/lib/tax.lib.php
Expand Up @@ -49,8 +49,12 @@ function tax_prepare_head($object)
// $this->tabs = array('entity:-tabname); to remove a tab
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][1] = $langs->trans("Documents");
if($nbFiles > 0) $head[$h][1].= ' ('.$nbFiles.')';
$head[$h][2] = 'documents';
$h++;

Expand Down
9 changes: 9 additions & 0 deletions htdocs/core/login/functions_ldap.php
Expand Up @@ -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);
// 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)
{
$user->login = $ldap->login;
Expand Down
48 changes: 24 additions & 24 deletions htdocs/fourn/commande/fiche.php
Expand Up @@ -701,38 +701,37 @@
// Fill array 'array_options' with data from add form
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);

if($ret < 0)
$error++;

if(!$error) {


if($ret < 0) $error++;

if (!$error)
{
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('supplierorderdao'));
$parameters=array('id'=>$object->id);

$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks

if (empty($reshook))
{
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used
{

$result=$object->insertExtraFields();

if ($result < 0)
{
$error++;
}

}
}
else if ($reshook < 0) $error++;
}
else
{
$action = 'edit_extras';
$action = 'edit_extras';
}
}

Expand Down Expand Up @@ -1119,12 +1118,12 @@
// Other options
$parameters=array();
$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))
{
print $object->showOptionals($extrafields,'edit');
}

// Bouton "Create Draft"
print "</table>\n";

Expand All @@ -1141,9 +1140,9 @@

$title=$langs->trans("SupplierOrder");
dol_fiche_head($head, 'card', $title, 0, 'order');

$res=$object->fetch_optionals($object->id,$extralabels);

/*
* Confirmation de la suppression de la commande
*/
Expand Down Expand Up @@ -1408,7 +1407,6 @@
// Other attributes
$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

if (empty($reshook) && ! empty($extrafields->attribute_label))
{
if ($action == 'edit_extras')
Expand All @@ -1418,15 +1416,15 @@
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
}

foreach($extrafields->attribute_label as $key=>$label)
{
if ($action == 'edit_extras') {
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
} else {
$value=$object->array_options["options_".$key];
}

if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
Expand All @@ -1441,7 +1439,7 @@
{
$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)
{
print $extrafields->showInputField($key,$value);
Expand All @@ -1450,28 +1448,30 @@
{
print $extrafields->showOutputField($key,$value);
}

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)
{
print '<tr><td></td><td colspan="5">';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
print '</td></tr>';
}
else {
else
{
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>';
}
}
}
}

// Ligne de 3 colonnes
print '<tr><td>'.$langs->trans("AmountHT").'</td>';
print '<td align="right"><b>'.price($object->total_ht).'</b></td>';
Expand Down
1 change: 0 additions & 1 deletion htdocs/langs/es_ES/admin.lang
Expand Up @@ -1010,7 +1010,6 @@ AddRefInList=Mostrar el código de cliente/proveedor en los listados (lista desp
FieldEdition=Edición del campo %s
FixTZ=Ajueste TimeZone
FillThisOnlyIfRequired=Ejemplo: +2 (Rellene únicamente si se experimentan problemas de offset de zona horaria)

##### Module password generation
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.
Expand Down
1 change: 0 additions & 1 deletion htdocs/langs/es_ES/main.lang
Expand Up @@ -666,7 +666,6 @@ SaveUploadedFileWithMask=Guardar el archivo con el nombre "<strong>%s</strong>"
OriginFileName=Nombre del archivo origen
SetDemandReason=Definir origen
ViewPrivateNote=Ver notas

# Week day
Monday=Lunes
Tuesday=Martes
Expand Down

0 comments on commit 9e5e74c

Please sign in to comment.