diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index e13a6af9fdf..6ff8843da54 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -121,7 +121,7 @@ if ($action=='delete_action') * View */ -$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; +$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda'; llxHeader('',$langs->trans("Agenda"),$help_url); $form=new Form($db); diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index d8a1b80e92f..74de137d0ca 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -133,11 +133,11 @@ if ($action == 'delete') { if (!empty($id)) { - $classname = "MailingTargets"; - $obj = new $classname($db); - $obj->update_nb($id); - - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + $classname = "MailingTargets"; + $obj = new $classname($db); + $obj->update_nb($id); + + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } else diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 924afb99e00..3b3b8caf5b9 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -121,7 +121,7 @@ class Mailing extends CommonObject } else { - $this->error=$this->db->lasterror(); + $this->error=$this->db->lasterror(); dol_syslog("Mailing::Create ".$this->error, LOG_ERR); $this->db->rollback(); return -1; diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 7f668a021e6..a8064da19f3 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -41,11 +41,11 @@ $action=GETPOST('action','alpha'); $confirm=GETPOST('confirm','alpha'); $urlfrom=GETPOST('urlfrom'); -$mesg=''; -if (isset($_SESSION['DolMessage'])) -{ - $mesg=$_SESSION['DolMessage']; - unset($_SESSION['DolMessage']); +$mesg=''; +if (isset($_SESSION['DolMessage'])) +{ + $mesg=$_SESSION['DolMessage']; + unset($_SESSION['DolMessage']); } $object=new Mailing($db); @@ -53,9 +53,9 @@ $result=$object->fetch($id); $extrafields = new ExtraFields($db); -// 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); +// 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('mailingcard')); // Tableau des substitutions possibles @@ -109,11 +109,11 @@ if ($conf->global->MAILING_EMAIL_UNSUBSCRIBE) ); } -/* - * Actions +/* + * Actions */ -$parameters=array(); +$parameters=array(); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks // Action clone object @@ -557,61 +557,61 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel" // Action confirmation validation if ($action == 'confirm_valid' && $confirm == 'yes') -{ - if ($object->id > 0) - { +{ + if ($object->id > 0) + { $object->valid($user); - $_SESSION['DolMessage']='
'.$langs->trans("MailingSuccessfullyValidated").'
'; - - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - dol_print_error($db); + $_SESSION['DolMessage']='
'.$langs->trans("MailingSuccessfullyValidated").'
'; + + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + dol_print_error($db); } } // Resend if ($action == 'confirm_reset' && $confirm == 'yes') -{ - if ($object->id > 0) - { - $db->begin(); - - $result=$object->valid($user); - if ($result > 0) - { - $result=$object->reset_targets_status($user); - } - - if ($result > 0) - { - $db->commit(); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); - exit; - } - else - { - $mesg=$object->error; - $db->rollback(); - } - } - else - { - dol_print_error($db); +{ + if ($object->id > 0) + { + $db->begin(); + + $result=$object->valid($user); + if ($result > 0) + { + $result=$object->reset_targets_status($user); + } + + if ($result > 0) + { + $db->commit(); + Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + exit; + } + else + { + $mesg=$object->error; + $db->rollback(); + } + } + else + { + dol_print_error($db); } } // Action confirmation suppression if ($action == 'confirm_delete' && $confirm == 'yes') -{ - if ($object->delete($object->id)) +{ + if ($object->delete($object->id)) { - $url= (! empty($urlfrom) ? $urlfrom : 'liste.php'); - Header("Location: ".$url); - exit; + $url= (! empty($urlfrom) ? $urlfrom : 'liste.php'); + Header("Location: ".$url); + exit; } } @@ -626,7 +626,7 @@ if (! empty($_POST["cancel"])) * View */ -// fetch optionals attributes and labels +// fetch optionals attributes and labels $extralabels=$extrafields->fetch_name_optionals_label('mailing'); $help_url='EN:Module_EMailing|FR:Module_Mailing|ES:Módulo_Mailing'; @@ -651,18 +651,18 @@ if ($action == 'create') print ''.$langs->trans("MailFrom").''; print ''.$langs->trans("MailErrorsTo").''; - // Other attributes - $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)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print ''.$label.''; - print $extrafields->showInputField($key,$value); - print ''."\n"; - } + // Other attributes + $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)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + print ''.$label.''; + print $extrafields->showInputField($key,$value); + print ''."\n"; + } } print ''; @@ -717,7 +717,7 @@ else // Confirm delete else if ($action == 'delete') { - $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id,$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1); + $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$object->id.(! empty($urlfrom) ? '&urlfrom='.urlencode($urlfrom) : ''),$langs->trans("DeleteAMailing"),$langs->trans("ConfirmDeleteMailing"),"confirm_delete",'','',1); if ($ret == 'html') print '
'; } @@ -809,18 +809,18 @@ else } print ''; - // Other attributes - $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)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print ''.$label.''; - print $extrafields->showInputField($key,$value); - print "\n"; - } + // Other attributes + $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)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + print ''.$label.''; + print $extrafields->showInputField($key,$value); + print "\n"; + } } print ''; @@ -861,11 +861,11 @@ else //print ''.$langs->trans("PreviewMailing").''; - if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send) - { - print ''.$langs->trans("TestMailing").''; - } - else + if (! empty($conf->global->MAIN_USE_ADVANCED_PERMS) && ! $user->rights->mailing->mailing_advance->send) + { + print ''.$langs->trans("TestMailing").''; + } + else { print ''.$langs->trans("TestMailing").''; } @@ -1043,18 +1043,18 @@ else } print ''; - // Other attributes - $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)) - { - foreach($extrafields->attribute_label as $key=>$label) - { - $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); - print ''.$label.''; - print $extrafields->showInputField($key,$value); - print "\n"; - } + // Other attributes + $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)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + print ''.$label.''; + print $extrafields->showInputField($key,$value); + print "\n"; + } } print ''; @@ -1119,9 +1119,9 @@ else // Message print ''.$langs->trans("MailMessage").'
'; print '
'.$langs->trans("CommonSubstitutions").':
'; - foreach($object->substitutionarray as $key => $val) - { - print $key.' = '.$langs->trans($val).'
'; + foreach($object->substitutionarray as $key => $val) + { + print $key.' = '.$langs->trans($val).'
'; } print '
'; print ''; diff --git a/htdocs/comm/propal/index.php b/htdocs/comm/propal/index.php index c3f07553948..ea518da991a 100644 --- a/htdocs/comm/propal/index.php +++ b/htdocs/comm/propal/index.php @@ -51,7 +51,7 @@ $propalstatic=new Propal($db); $companystatic=new Societe($db); $form = new Form($db); $formfile = new FormFile($db); -$help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo Presupuestos"; +$help_url="EN:Module_Commercial_Proposals|FR:Module_Propositions_commerciales|ES:Módulo_Presupuestos"; llxHeader("",$langs->trans("ProspectionArea"),$help_url); diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php index d70aaf52af1..c2000d6b8b1 100644 --- a/htdocs/commande/index.php +++ b/htdocs/commande/index.php @@ -49,7 +49,7 @@ if ($user->societe_id > 0) $commandestatic=new Commande($db); $form = new Form($db); $formfile = new FormFile($db); -$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo Pedidos de clientes"; +$help_url="EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_Pedidos_de_clientes"; llxHeader("",$langs->trans("Orders"),$help_url); diff --git a/htdocs/core/lib/functions2.lib.php b/htdocs/core/lib/functions2.lib.php index 93fa494623c..d938d41e974 100644 --- a/htdocs/core/lib/functions2.lib.php +++ b/htdocs/core/lib/functions2.lib.php @@ -416,6 +416,7 @@ function clean_url($url,$http=1) return $CleanUrl; } + else return $url; } /** diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 650b83c6016..d5c8dcfcb5d 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -239,12 +239,36 @@ function pdf_build_address($outputlangs,$sourcecompany,$targetcompany='',$target $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcontact))."\n"; // Country if ($targetcontact->country_code && $targetcontact->country_code != $sourcecompany->pays_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcontact->pays_code))."\n"; + + if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) + { + // Tel + if ($targetcontact->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcontact->tel); + // Fax + if ($targetcontact->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcontact->fax); + // EMail + if ($targetcontact->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcontact->email); + // Web + if ($targetcontact->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcontact->url); + } } else { $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->convToOutputCharset(dol_format_address($targetcompany))."\n"; // Country if ($targetcompany->country_code && $targetcompany->country_code != $sourcecompany->pays_code) $stringaddress.=$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Country".$targetcompany->pays_code))."\n"; + + if (! empty($conf->global->MAIN_PDF_ADDALSOTARGETDETAILS)) + { + // Tel + if ($targetcompany->tel) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Phone").": ".$outputlangs->convToOutputCharset($targetcompany->tel); + // Fax + if ($targetcompany->fax) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Fax").": ".$outputlangs->convToOutputCharset($targetcompany->fax); + // EMail + if ($targetcompany->email) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Email").": ".$outputlangs->convToOutputCharset($targetcompany->email); + // Web + if ($targetcompany->url) $stringaddress .= ($stringaddress ? "\n" : '' ).$outputlangs->transnoentities("Web").": ".$outputlangs->convToOutputCharset($targetcompany->url); + } } // Intra VAT diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index b63891a5d46..1b7364fc180 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -450,14 +450,14 @@ if (empty($reshook)) } } } - + // Remove file in doc form else if ($action == 'remove_file') { if ($object->fetch($socid)) { require_once(DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"); - + $langs->load("other"); $upload_dir = $conf->societe->dir_output; $file = $upload_dir . '/' . GETPOST('file');