diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index f686109d015..55b6543c195 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -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']; } diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 84718e7dc89..cc5251e6592 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2,7 +2,7 @@ /* Copyright (C) 2003-2006 Rodolphe Quiedeville * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2013 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2013 Juanjo Menent * Copyright (C) 2011 Philippe Grand @@ -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']; } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 041bb42633f..6b145ffd4f2 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -3,7 +3,7 @@ * Copyright (C) 2004 Eric Seigne * Copyright (C) 2004-2014 Laurent Destailleur * Copyright (C) 2005 Marc Barilley / Ocebo - * Copyright (C) 2005-2012 Regis Houssin + * Copyright (C) 2005-2015 Regis Houssin * Copyright (C) 2006 Andre Cianfarani * Copyright (C) 2010-2015 Juanjo Menent * Copyright (C) 2012-2013 Christophe Battarel @@ -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']; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 35b6e8565c4..48bbe2ace8d 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -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
\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 { diff --git a/htdocs/core/tpl/document_actions_post_headers.tpl.php b/htdocs/core/tpl/document_actions_post_headers.tpl.php index c7d5dc2c083..84b869cd813 100644 --- a/htdocs/core/tpl/document_actions_post_headers.tpl.php +++ b/htdocs/core/tpl/document_actions_post_headers.tpl.php @@ -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'))) { diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 344e17166ad..06395c89526 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -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']; } diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index 3409c075761..e6c9c4d00d6 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -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']; } diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index b56bba0c4a5..8ae5b6da1ee 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -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']; } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 2491c6eaff6..cda640f2f38 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -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']; } diff --git a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql index 399f8099ca6..dd0aba11632 100755 --- a/htdocs/install/mysql/migration/3.6.0-3.7.0.sql +++ b/htdocs/install/mysql/migration/3.6.0-3.7.0.sql @@ -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; diff --git a/htdocs/public/demo/index.php b/htdocs/public/demo/index.php index 956bcac8b75..4b0c0526174 100644 --- a/htdocs/public/demo/index.php +++ b/htdocs/public/demo/index.php @@ -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')); diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index fd745e523c9..fc96ffed01c 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -65,7 +65,11 @@ $extrafields = new ExtraFields($db); * View */ -llxHeaderVierge($langs->trans("MemberCard")); +$morehead=''; +if (! empty($conf->global->MEMBER_PUBLIC_CSS)) $morehead=''; +else $morehead=''; + +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 ''; + print '
'; print '\n"; print ''; @@ -138,7 +142,7 @@ function llxHeaderVierge($title, $head = "") print "".$title."\n"; if ($head) print $head."\n"; print "\n"; - print "\n"; + print ''."\n"; } /** diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index e672a6d59d3..9064dd52879 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -62,7 +62,7 @@ function llxHeaderVierge($title, $head = "") print "".$title."\n"; if ($head) print $head."\n"; print "\n"; - print "\n"; + print ''."\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=''; +else $morehead=''; + +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 '
'.$langs->trans("Type").''.$object->type."
'.$langs->trans("Person").''.$object->morphy.'
'; + print '
'; - print ''; - print ''."\n"; + print ''; + print ''; + print ''."\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 "\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 "\n"; $var=True; @@ -139,13 +144,13 @@ if ($result) $objp = $db->fetch_object($result); $var=!$var; print ""; - print ''."\n"; + print ''."\n"; + print ''."\n"; print ''."\n"; print ''."\n"; print ''."\n"; if (isset($objp->photo) && $objp->photo != '') { - $form = new Form($db); print ''."\n"; @@ -165,6 +170,6 @@ else } -$db->close(); - llxFooterVierge(); + +$db->close(); diff --git a/htdocs/theme/eldy/style.css.php b/htdocs/theme/eldy/style.css.php index a6281c8aca0..66cb0178bb6 100644 --- a/htdocs/theme/eldy/style.css.php +++ b/htdocs/theme/eldy/style.css.php @@ -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; } } + + close();
'.$langs->trans("Firstname").''; - print ' '.$langs->trans("Lastname").''; - print ' / '.$langs->trans("Company").'
'.dolGetFirstLastname($langs->trans("Firstname"),$langs->trans("Lastname")).''.$langs->trans("Company").'".$langs->trans("Photo")."
'.dolGetFirstLastname($obj->firstname, $obj->lastname).($objp->societe?' / '.$objp->societe:'').''.dolGetFirstLastname($objp->firstname, $objp->lastname).''.$objp->societe.''.$objp->email.''.$objp->zip.''.$objp->town.''; print $form->showphoto('memberphoto', $objp, 64); print '