Generalize fix: file with a specific mask not found, again

This commit is contained in:
Laurent Destailleur 2013-03-30 13:54:46 +01:00
parent c75ce97960
commit a5e66ab7ba
7 changed files with 57 additions and 57 deletions

View File

@ -1107,7 +1107,7 @@ else if ($action == 'update_extras')
// Fill array 'array_options' with data from update form
$extralabels=$extrafields->fetch_name_optionals_label('propal');
$ret = $extrafields->setOptionalsFromPost($extralabels,$object);
// Actions on extra fields (by external module or standard code)
// FIXME le hook fait double emploi avec le trigger !!
$hookmanager->initHooks(array('propaldao'));
@ -1125,7 +1125,7 @@ else if ($action == 'update_extras')
}
}
else if ($reshook < 0) $error++;
}
if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal->creer)
@ -1350,13 +1350,13 @@ if ($action == 'create')
foreach($extrafields->attribute_label as $key=>$label)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
// Show separator only
if ($extrafields->attribute_type[$key] == 'separate')
{
print $extrafields->showSeparator($key);
}
else
else
{
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
@ -1840,7 +1840,7 @@ else
$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')
{
print '<form enctype="multipart/form-data" action="'.$_SERVER["PHP_SELF"].'" method="post" name="formsoc">';
@ -1848,8 +1848,8 @@ else
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)
{
$value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]);
@ -1862,13 +1862,13 @@ else
print '<tr><td';
if (! empty($extrafields->attribute_required[$key])) print ' class="fieldrequired"';
print '>'.$label.'</td><td colspan="3">';
// Convert date into timestamp format
if (in_array($extrafields->attribute_type[$key],array('date','datetime')))
{
$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"]):$object->array_options['options_'.$key];
}
if ($action == 'edit_extras' && $user->rights->propal->creer)
{
print $extrafields->showInputField($key,$value);
@ -1880,19 +1880,19 @@ else
print '</td></tr>'."\n";
}
}
if(count($extrafields->attribute_label) > 0) {
if ($action == 'edit_extras' && $user->rights->propal->creer)
{
print '<tr><td></td><td>';
print '<input type="submit" class="button" value="'.$langs->trans('Modify').'">';
print '</form>';
print '</td></tr>';
}
else {
if ($object->statut == 0 && $user->rights->propal->creer)
if ($object->statut == 0 && $user->rights->propal->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>';
}
@ -2182,7 +2182,7 @@ else
{
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
// Build document if it not exists
@ -2205,7 +2205,7 @@ else
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
}
@ -2236,12 +2236,12 @@ else
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
//Find the good contact adress
$custcontact='';
$contactarr=array();
$contactarr=$object->liste_contact(-1,'external');
if (is_array($contactarr) && count($contactarr)>0) {
foreach($contactarr as $contact) {
if ($contact['libelle']==$langs->trans('TypeContact_propal_external_CUSTOMER')) {
@ -2250,19 +2250,19 @@ else
$custcontact=$contactstatic->getFullName($langs,1);
}
}
if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}
// Tableau des parametres complementaires
$formmail->param['action']='send';
$formmail->param['models']='propal_send';
$formmail->param['id']=$object->id;
$formmail->param['returnurl']=$_SERVER["PHP_SELF"].'?id='.$object->id;
// Init list of files
if (GETPOST("mode")=='init')
{

View File

@ -2390,7 +2390,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
{
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
// Build document if it not exists
@ -2413,7 +2413,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
}
@ -2443,11 +2443,11 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
$custcontact='';
$contactarr=array();
$contactarr=$object->liste_contact(-1,'external');
if (is_array($contactarr) && count($contactarr)>0) {
foreach($contactarr as $contact) {
if ($contact['libelle']==$langs->trans('TypeContact_commande_external_CUSTOMER')) {
@ -2456,12 +2456,12 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$custcontact=$contactstatic->getFullName($langs,1);
}
}
if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}
// Tableau des parametres complementaires
$formmail->param['action']='send';
$formmail->param['models']='order_send';

View File

@ -3138,7 +3138,7 @@ else if ($id > 0 || ! empty($ref))
{
$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"]):$object->array_options['options_'.$key];
}
if ($action == 'edit_extras' && $user->rights->facture->creer)
{
print $extrafields->showInputField($key,$value);
@ -3511,7 +3511,7 @@ else if ($id > 0 || ! empty($ref))
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
// Build document if it not exists
@ -3534,7 +3534,7 @@ else if ($id > 0 || ! empty($ref))
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
}
@ -3563,31 +3563,31 @@ else if ($id > 0 || ! empty($ref))
$formmail->substit['__FACREF__']=$object->ref;
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
//Find the good contact adress
$custcontact='';
$contactarr=array();
$contactarr=$object->liste_contact(-1,'external');
if (is_array($contactarr) && count($contactarr)>0) {
foreach($contactarr as $contact) {
if ($contact['libelle']==$langs->trans('TypeContact_facture_external_BILLING')) {
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
$contactstatic=new Contact($db);
$contactstatic->fetch($contact['id']);
$custcontact=$contactstatic->getFullName($langs,1);
}
}
if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}
// Tableau des parametres complementaires du post
$formmail->param['action']=$action;
$formmail->param['models']=$modelmail;

View File

@ -1405,7 +1405,7 @@ else
{
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
// Build document if it not exists
@ -1428,7 +1428,7 @@ else
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
}
@ -1458,7 +1458,7 @@ else
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
//Find the good contact adress
//Find the good contact adress
if ($typeobject == 'commande' && $object->$typeobject->id && ! empty($conf->commande->enabled)) {
@ -1475,22 +1475,22 @@ else
if (is_array($contactarr) && count($contactarr)>0) {
foreach($contactarr as $contact) {
if ($contact['libelle']==$langs->trans('TypeContact_commande_external_CUSTOMER')) {
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
$contactstatic=new Contact($db);
$contactstatic->fetch($contact['id']);
$custcontact=$contactstatic->getFullName($langs,1);
}
}
if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}
// Tableau des parametres complementaires
$formmail->param['action']='send';
$formmail->param['models']='shipping_send';

View File

@ -1068,7 +1068,7 @@ else if ($id > 0 || ! empty($ref))
$numref = $object->ref;
}
$text=$langs->trans('ConfirmValidateIntervention',$numref);
$ret=$form->form_confirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ValidateIntervention'), $text, 'confirm_validate','',0,1);
if ($ret == 'html') print '<br>';
}
@ -1465,7 +1465,7 @@ else if ($id > 0 || ! empty($ref))
{
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
// Build document if it not exists
@ -1488,7 +1488,7 @@ else if ($id > 0 || ! empty($ref))
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
}
@ -1519,12 +1519,12 @@ else if ($id > 0 || ! empty($ref))
$formmail->substit['__SIGNATURE__']=$user->signature;
$formmail->substit['__PERSONALIZED__']='';
$formmail->substit['__CONTACTCIVNAME__']='';
//Find the good contact adress
$custcontact='';
$contactarr=array();
$contactarr=$object->liste_contact(-1,'external');
if (is_array($contactarr) && count($contactarr)>0) {
foreach($contactarr as $contact) {
if ($contact['libelle']==$langs->trans('TypeContact_fichinter_external_CUSTOMER')) {
@ -1534,12 +1534,12 @@ else if ($id > 0 || ! empty($ref))
$custcontact=$contactstatic->getFullName($langs,1);
}
}
if (!empty($custcontact)) {
$formmail->substit['__CONTACTCIVNAME__']=$custcontact;
}
}
// Tableau des parametres complementaires
$formmail->param['action']='send';
$formmail->param['models']='fichinter_send';

View File

@ -1855,7 +1855,7 @@ elseif (! empty($object->id))
{
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
// Build document if it not exists
@ -1878,7 +1878,7 @@ elseif (! empty($object->id))
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
}

View File

@ -2071,7 +2071,7 @@ else
{
$ref = dol_sanitizeFileName($object->ref);
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
// Build document if it not exists
@ -2094,7 +2094,7 @@ else
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($object->ref,'/'));
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/'));
$file=$fileparams['fullname'];
}