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

Conflicts:
	htdocs/comm/propal.php
	htdocs/commande/card.php
	htdocs/compta/facture.php
	htdocs/core/class/html.form.class.php
	htdocs/fourn/facture/card.php
	htdocs/theme/eldy/style.css.php
This commit is contained in:
Laurent Destailleur 2015-06-08 18:28:50 +02:00
commit 9b7982bf0c
14 changed files with 69 additions and 41 deletions

View File

@ -2340,7 +2340,7 @@ if ($action == 'create')
$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($ref, '/'));
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file = $fileparams['fullname'];
// Define output language
@ -2365,7 +2365,7 @@ if ($action == 'create')
dol_print_error($db, $result);
exit();
}
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/'));
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file = $fileparams['fullname'];
}

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
@ -2334,7 +2334,6 @@ if ($action == 'create' && $user->rights->commande->creer)
$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($ref, '/'));
$file = $fileparams['fullname'];
// Define output language
@ -2359,7 +2358,7 @@ if ($action == 'create' && $user->rights->commande->creer)
dol_print_error($db, $result);
exit();
}
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/'));
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file = $fileparams['fullname'];
}

View File

@ -3,7 +3,7 @@
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2005-2015 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012-2013 Christophe Battarel <christophe.battarel@altairis.fr>
@ -3821,7 +3821,7 @@ if ($action == 'create')
$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($ref, '/'));
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file = $fileparams['fullname'];
// Define output language
@ -3846,7 +3846,7 @@ if ($action == 'create')
dol_print_error($db, $result);
exit();
}
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/'));
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file = $fileparams['fullname'];
}

View File

@ -2637,11 +2637,12 @@ function dol_print_error_email($prefixcode)
* @param string $td Options of attribute td ("" by defaut, example: 'align="center"')
* @param string $sortfield Current field used to sort
* @param string $sortorder Current sort order
* @param string $prefix Prefix for css
* @return void
*/
function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="")
function print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $td="", $sortfield="", $sortorder="", $prefix="")
{
print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder);
print getTitleFieldOfList($name, 0, $file, $field, $begin, $moreparam, $td, $sortfield, $sortorder, $prefix);
}
/**
@ -2656,9 +2657,10 @@ function print_liste_field_titre($name, $file="", $field="", $begin="", $morepar
* @param string $moreattrib Add more attributes on th ("" by defaut)
* @param string $sortfield Current field used to sort
* @param string $sortorder Current sort order
* @param string $prefix Prefix for css
* @return string
*/
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="")
function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="")
{
global $conf;
//print "$name, $file, $field, $begin, $options, $moreattrib, $sortfield, $sortorder<br>\n";
@ -2672,7 +2674,7 @@ function getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $m
// If field is used as sort criteria we use a specific class
// Example if (sortfield,field)=("nom","xxx.nom") or (sortfield,field)=("nom","nom")
if ($field && ($sortfield == $field || $sortfield == preg_replace("/^[^\.]+\./","",$field))) $out.= '<'.$tag.' class="liste_titre_sel" '. $moreattrib.'>';
else $out.= '<'.$tag.' class="liste_titre" '. $moreattrib.'>';
else $out.= '<'.$tag.' class="'.$prefix.'liste_titre" '. $moreattrib.'>';
if (! empty($conf->dol_optimize_smallscreen) && empty($thead) && $field) // If this is a sort field
{

View File

@ -49,7 +49,7 @@ if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
//var_dump($modulepart);
if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','askpricesupplier','ficheinter','contract','project','project_task','expensereport')))
{
$savingdocmask=$object->ref.'___file__';
$savingdocmask=$object->ref.'-__file__';
}
/*if (in_array($modulepart,array('member')))
{

View File

@ -1530,7 +1530,7 @@ else if ($id || $ref)
{
$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($ref,'/'));
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file=$fileparams['fullname'];
// Define output language
@ -1557,7 +1557,7 @@ else if ($id || $ref)
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file=$fileparams['fullname'];
}

View File

@ -1755,7 +1755,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($ref,'/'));
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file=$fileparams['fullname'];
// Define output language
@ -1782,7 +1782,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($ref,'/'));
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file=$fileparams['fullname'];
}

View File

@ -2265,7 +2265,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($ref,'/'));
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file=$fileparams['fullname'];
// Define output language
@ -2292,7 +2292,7 @@ elseif (! empty($object->id))
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'([^\-])+');
$file=$fileparams['fullname'];
}

View File

@ -2443,7 +2443,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,0,0,$object,'invoice_supplier').$ref, preg_quote($ref,'/'));
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref, preg_quote($ref,'/').'([^\-])+');
$file=$fileparams['fullname'];
// Define output language
@ -2470,7 +2470,7 @@ else
dol_print_error($db,$result);
exit;
}
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref, preg_quote($ref,'/'));
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2,0,0,$object,'invoice_supplier').$ref, preg_quote($ref,'/').'([^\-])+');
$file=$fileparams['fullname'];
}

View File

@ -208,10 +208,14 @@ UPDATE llx_product SET fk_barcode_type = NULL WHERE fk_barcode_type NOT IN (SELE
ALTER TABLE llx_product_price ADD INDEX idx_product_price_fk_user_author (fk_user_author);
UPDATE llx_product_price set fk_user_author = null where fk_user_author = 0;
UPDATE llx_product_price set fk_user_author = null where fk_user_author not in (select rowid from llx_user);
-- drop foreign key for avoid a mysql crash
ALTER TABLE llx_product_price DROP FOREIGN KEY fk_product_price_user_author;
ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_user_author FOREIGN KEY (fk_user_author) REFERENCES llx_user (rowid);
-- fk_product
ALTER TABLE llx_product_price ADD INDEX idx_product_price_fk_product (fk_product);
DELETE from llx_product_price where fk_product NOT IN (SELECT rowid from llx_product);
-- drop foreign key for avoid a mysql crash
ALTER TABLE llx_product_price DROP FOREIGN KEY fk_product_price_product;
ALTER TABLE llx_product_price ADD CONSTRAINT fk_product_price_product FOREIGN KEY (fk_product) REFERENCES llx_product (rowid);
ALTER TABLE llx_commande_fournisseur MODIFY COLUMN date_livraison datetime;

View File

@ -41,7 +41,7 @@ $conf->dol_use_jmobile=GETPOST('dol_use_jmobile','int');
// Security check
global $dolibarr_main_demo;
if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page',1,1,1);
if (empty($dolibarr_main_demo)) accessforbidden('Parameter dolibarr_main_demo must be defined in conf file with value "default login,default pass" to enable the demo entry page',0,0,1);
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$res=$hookmanager->initHooks(array('demo'));

View File

@ -65,7 +65,11 @@ $extrafields = new ExtraFields($db);
* View
*/
llxHeaderVierge($langs->trans("MemberCard"));
$morehead='';
if (! empty($conf->global->MEMBER_PUBLIC_CSS)) $morehead='<link rel="stylesheet" type="text/css" href="'.$conf->global->MEMBER_PUBLIC_CSS.'">';
else $morehead='<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/eldy/style.css.php'.'">';
llxHeaderVierge($langs->trans("MemberCard"), $morehead);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label('adherent');
@ -75,7 +79,7 @@ if ($id > 0)
if ($res < 0) { dol_print_error($db,$object->error); exit; }
$res=$object->fetch_optionals($object->id,$extralabels);
print_titre($langs->trans("MemberCard"));
print_fiche_titre($langs->trans("MemberCard"), '', '');
if (empty($object->public))
{
@ -83,7 +87,7 @@ if ($id > 0)
}
else
{
print '<table class="border" cellspacing="0" width="100%" cellpadding="3">';
print '<table class="public_border" cellspacing="0" width="100%" cellpadding="3">';
print '<tr><td width="15%">'.$langs->trans("Type").'</td><td class="valeur">'.$object->type."</td></tr>\n";
print '<tr><td>'.$langs->trans("Person").'</td><td class="valeur">'.$object->morphy.'</td></tr>';
@ -138,7 +142,7 @@ function llxHeaderVierge($title, $head = "")
print "<title>".$title."</title>\n";
if ($head) print $head."\n";
print "</head>\n";
print "<body>\n";
print '<body class="public_body">'."\n";
}
/**

View File

@ -62,7 +62,7 @@ function llxHeaderVierge($title, $head = "")
print "<title>".$title."</title>\n";
if ($head) print $head."\n";
print "</head>\n";
print "<body>\n";
print '<body class="public_body">'."\n";
}
/**
@ -98,7 +98,13 @@ if (! $sortfield) { $sortfield="lastname"; }
* View
*/
llxHeaderVierge($langs->trans("ListOfValidatedPublicMembers"));
$form = new Form($db);
$morehead='';
if (! empty($conf->global->MEMBER_PUBLIC_CSS)) $morehead='<link rel="stylesheet" type="text/css" href="'.$conf->global->MEMBER_PUBLIC_CSS.'">';
else $morehead='<link rel="stylesheet" type="text/css" href="'.DOL_URL_ROOT.'/theme/eldy/style.css.php'.'">';
llxHeaderVierge($langs->trans("ListOfValidatedPublicMembers"), $morehead);
$sql = "SELECT rowid, firstname, lastname, societe, zip, town, email, birth, photo";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent";
@ -120,17 +126,16 @@ if ($result)
$param="&statut=$statut&sortorder=$sortorder&sortfield=$sortfield";
print_barre_liste($langs->trans("ListOfValidatedPublicMembers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, 0, '');
print '<table class="noborder" width="100%">';
print '<table class="public_border" width="100%">';
print '<tr class="liste_titre">';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?page='.$page.'&sortorder=ASC&sortfield=firstname">'.$langs->trans("Firstname").'</a>';
print ' <a href="'.$_SERVER['PHP_SELF'].'?page='.$page.'&sortorder=ASC&sortfield=lastname">'.$langs->trans("Lastname").'</a>';
print ' / <a href="'.$_SERVER["PHP_SELF"].'?page='.$page.'&sortorder=ASC&sortfield=societe">'.$langs->trans("Company").'</a></td>'."\n";
print '<tr class="public_liste_titre">';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?page='.$page.'&sortorder=ASC&sortfield=firstname">'.dolGetFirstLastname($langs->trans("Firstname"),$langs->trans("Lastname")).'</a></td>';
print '<td><a href="'.$_SERVER["PHP_SELF"].'?page='.$page.'&sortorder=ASC&sortfield=societe">'.$langs->trans("Company").'</a></td>'."\n";
//print_liste_field_titre($langs->trans("DateToBirth"), $_SERVER["PHP_SELF"],"birth",'',$param,$sortfield,$sortorder); // est-ce nécessaire ??
print_liste_field_titre($langs->trans("EMail"), $_SERVER["PHP_SELF"],"email",'',$param,$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Zip"), $_SERVER["PHP_SELF"],"zip","",$param,$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Town"), $_SERVER["PHP_SELF"],"town","",$param,$sortfield,$sortorder);
print "<td>".$langs->trans("Photo")."</td>\n";
print_liste_field_titre($langs->trans("EMail"), $_SERVER["PHP_SELF"],"email",'',$param,'',$sortfield,$sortorder,'public_');
print_liste_field_titre($langs->trans("Zip"), $_SERVER["PHP_SELF"],"zip","",$param,'',$sortfield,$sortorder,'public_');
print_liste_field_titre($langs->trans("Town"), $_SERVER["PHP_SELF"],"town","",$param,'',$sortfield,$sortorder,'public_');
print_liste_field_titre($langs->trans("Photo"), $_SERVER["PHP_SELF"],"","",$param,'',$sortfield,$sortorder,'public_');
print "</tr>\n";
$var=True;
@ -139,13 +144,13 @@ if ($result)
$objp = $db->fetch_object($result);
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td><a href="public_card.php?id='.$objp->rowid.'">'.dolGetFirstLastname($obj->firstname, $obj->lastname).($objp->societe?' / '.$objp->societe:'').'</a></td>'."\n";
print '<td><a href="public_card.php?id='.$objp->rowid.'">'.dolGetFirstLastname($objp->firstname, $objp->lastname).'</a></td>'."\n";
print '<td>'.$objp->societe.'</td>'."\n";
print '<td>'.$objp->email.'</td>'."\n";
print '<td>'.$objp->zip.'</td>'."\n";
print '<td>'.$objp->town.'</td>'."\n";
if (isset($objp->photo) && $objp->photo != '')
{
$form = new Form($db);
print '<td>';
print $form->showphoto('memberphoto', $objp, 64);
print '</td>'."\n";
@ -165,6 +170,6 @@ else
}
$db->close();
llxFooterVierge();
$db->close();

View File

@ -3548,6 +3548,18 @@ border-top-right-radius: 6px;
}
/* The theme for public pages */
.public_body {
margin: 20px;
}
.public_border {
border: 1px solid #888;
}
.public_liste_titre {
/* CSS style used for small screen */
.imgopensurveywizard
@ -3559,5 +3571,7 @@ border-top-right-radius: 6px;
.imgopensurveywizard { width:95%; height: auto; }
}
<?php
if (is_object($db)) $db->close();