diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php index 5e96d038314..1bdf4e75e5d 100644 --- a/htdocs/comm/card.php +++ b/htdocs/comm/card.php @@ -207,8 +207,9 @@ if ($id > 0) dol_fiche_head($head, 'customer', $langs->trans("ThirdParty"),0,'company'); - - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 31a7a5eec6a..347d77e84dd 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -1427,7 +1427,7 @@ else { $total = 0; - print ''; + print ''; print ''.$langs->trans("ServiceNb",$cursorline).''; print ''.$langs->trans("VAT").''; print ''.$langs->trans("PriceUHT").''; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 5731ba7c63d..3e7d02ed67a 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4211,7 +4211,9 @@ abstract class CommonObject $object = new $InfoFieldList[0]($this->db); if ($value) { - $res=$object->fetch(0,$value); + if (is_numeric($value)) $res=$object->fetch($value); + else $res=$object->fetch('',$value); + if ($res > 0) $this->array_options[$key]=$object->id; else { diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index da198027936..b035095b1a7 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1133,7 +1133,7 @@ class Form $resql=$this->db->query($sql); if ($resql) { - print ''; $num = $this->db->num_rows($resql); $qualifiedlines=$num; diff --git a/htdocs/core/class/utils.class.php b/htdocs/core/class/utils.class.php index dd4096c5257..2724d64f17f 100644 --- a/htdocs/core/class/utils.class.php +++ b/htdocs/core/class/utils.class.php @@ -168,7 +168,7 @@ class Utils // Check type parameter if ($type == 'auto') $type = $db->type; - if (! in_array($type, array('pgsql', 'mysql', 'mysqli'))) + if (! in_array($type, array('pgsql', 'mysql', 'mysqli','mysqlnobin'))) { $langs->load("errors"); $this->error=$langs->transnoentitiesnoconv("ErrorBadValueForParameter", $type, "Basetype"); diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 0ab255c6f99..62866e31ea1 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -56,7 +56,7 @@ if (in_array($object->element,array('propal', 'supplier_proposal','facture','fac $nolinesbefore=(count($this->lines) == 0); if ($nolinesbefore) { ?> - + global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>>
trans('AddNewLine'); ?>trans("FreeZone"); ?> diff --git a/htdocs/fourn/card.php b/htdocs/fourn/card.php index 39f0009fbf4..195dff26029 100644 --- a/htdocs/fourn/card.php +++ b/htdocs/fourn/card.php @@ -132,7 +132,9 @@ if ($object->id > 0) dol_fiche_head($head, 'supplier', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/fourn/commande/list.php b/htdocs/fourn/commande/list.php index d731c4b6200..d184845cb76 100644 --- a/htdocs/fourn/commande/list.php +++ b/htdocs/fourn/commande/list.php @@ -130,8 +130,8 @@ if (empty($user->socid)) $fieldstosearchall["cf.note_private"]="NotePrivate"; $checkedtypetiers=0; $arrayfields=array( 'cf.ref'=>array('label'=>$langs->trans("Ref"), 'checked'=>1), - 'cf.ref_supplier'=>array('label'=>$langs->trans("RefOrderSupplier"), 'checked'=>1, 'enabled'=>$conf->global->SUPPLIER_ORDER_HIDE_REF_SUPPLIER), - 'p.project_ref'=>array('label'=>$langs->trans("ProjectRef"), 'enabled'=>$conf->global->PROJECT_SHOW_REF_INTO_LISTS), + 'cf.ref_supplier'=>array('label'=>$langs->trans("RefOrderSupplier"), 'checked'=>1, 'enabled'=>1), + 'p.project_ref'=>array('label'=>$langs->trans("ProjectRef"), 'checked'=>0, 'enabled'=>1), 'u.login'=>array('label'=>$langs->trans("AuthorRequest"), 'checked'=>1), 's.nom'=>array('label'=>$langs->trans("ThirdParty"), 'checked'=>1), 's.town'=>array('label'=>$langs->trans("Town"), 'checked'=>1), diff --git a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql index a747164e04c..9e1fe249834 100644 --- a/htdocs/install/mysql/migration/3.9.0-4.0.0.sql +++ b/htdocs/install/mysql/migration/3.9.0-4.0.0.sql @@ -61,6 +61,10 @@ CREATE TABLE llx_product_lot ( ALTER TABLE llx_product_lot ADD UNIQUE INDEX uk_product_lot(fk_product, batch); +-- VPGSQL8.2 ALTER TABLE llx_product_lot ALTER COLUMN entity SET DEFAULT 1; +ALTER TABLE llx_product_lot MODIFY COLUMN entity integer DEFAULT 1; +UPDATE llx_product_lot SET entity = 1 WHERE entity IS NULL; + DROP TABLE llx_stock_serial; ALTER TABLE llx_product ADD COLUMN note_public text; diff --git a/htdocs/install/mysql/tables/llx_multicurrency_rate.sql b/htdocs/install/mysql/tables/llx_multicurrency_rate.sql index 74661088751..545807c8aed 100644 --- a/htdocs/install/mysql/tables/llx_multicurrency_rate.sql +++ b/htdocs/install/mysql/tables/llx_multicurrency_rate.sql @@ -23,5 +23,5 @@ CREATE TABLE llx_multicurrency_rate date_sync datetime DEFAULT NULL, rate double NOT NULL DEFAULT 0, fk_multicurrency integer NOT NULL, - entity integer DEFAULT 1, -) ENGINE=innodb; \ No newline at end of file + entity integer DEFAULT 1 +) ENGINE=innodb; diff --git a/htdocs/margin/tabs/thirdpartyMargins.php b/htdocs/margin/tabs/thirdpartyMargins.php index 1d4d1f8f0ca..4797f0985e0 100644 --- a/htdocs/margin/tabs/thirdpartyMargins.php +++ b/htdocs/margin/tabs/thirdpartyMargins.php @@ -91,7 +91,9 @@ if ($socid > 0) dol_fiche_head($head, 'margin', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/opensurvey/card.php b/htdocs/opensurvey/card.php index 26ee7fe567c..dc0acb48d96 100644 --- a/htdocs/opensurvey/card.php +++ b/htdocs/opensurvey/card.php @@ -48,8 +48,8 @@ $object=new Opensurveysondage($db); $result=$object->fetch(0, $numsondage); if ($result <= 0) { - dol_print_error($db,$object->error); - exit; + dol_print_error($db,$object->error); + exit; } $expiredate=dol_mktime(0, 0, 0, GETPOST('expiremonth'), GETPOST('expireday'), GETPOST('expireyear')); @@ -206,7 +206,6 @@ foreach ($toutsujet as $value) $toutsujet=str_replace("@","
",$toutsujet); $toutsujet=str_replace("°","'",$toutsujet); - print '
'."\n"; print ''; @@ -444,8 +443,6 @@ if ($object->allow_comments) { print '
'; -print '
'; - -llxFooterSurvey(); +llxFooter(); $db->close(); diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 02952f4bf75..5ad27731d88 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -228,8 +228,7 @@ class Opensurveysondage extends CommonObject $obj = $this->db->fetch_object($resql); $this->id_sondage = $obj->id_sondage; - //For compatibility - $this->ref = $this->id_sondage; + $this->ref = $this->id_sondage; //For compatibility $this->commentaires = $obj->description; // deprecated $this->description = $obj->description; diff --git a/htdocs/public/opensurvey/studs.php b/htdocs/public/opensurvey/studs.php index 834f17b8b2c..6f242a00544 100644 --- a/htdocs/public/opensurvey/studs.php +++ b/htdocs/public/opensurvey/studs.php @@ -41,7 +41,6 @@ if (GETPOST('sondage')) $object=new Opensurveysondage($db); $result=$object->fetch(0,$numsondage); -if ($result <= 0) dol_print_error('','Failed to get survey id '.$numsondage); $nblignes=$object->fetch_lines(); @@ -241,6 +240,16 @@ $arrayofjs=array(); $arrayofcss=array('/opensurvey/css/style.css'); llxHeaderSurvey($object->titre, "", 0, 0, $arrayofjs, $arrayofcss); +if (empty($object->ref)) // For survey, id is a hex string +{ + $langs->load("errors"); + print $langs->trans("ErrorRecordNotFound"); + + llxFooterSurvey(); + + $db->close(); + exit; +} // Define format of choices $toutsujet=explode(",",$object->sujet); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 7d68e067265..4a46a5ed934 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -81,7 +81,9 @@ if ($socid) dol_fiche_head($head, 'agenda', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index e0f5ab7ec91..dd8802779b8 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -114,7 +114,9 @@ if (! empty($socid)) dol_fiche_head($head, 'salesrepresentative', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/societe/consumption.php b/htdocs/societe/consumption.php index eb912548caa..da3792d0897 100644 --- a/htdocs/societe/consumption.php +++ b/htdocs/societe/consumption.php @@ -114,7 +114,9 @@ if (empty($socid)) $head = societe_prepare_head($object); dol_fiche_head($head, 'consumption', $langs->trans("ThirdParty"),0,'company'); -dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); +$linkback = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/societe/document.php b/htdocs/societe/document.php index 4ad8abc9a43..e64c9c49656 100644 --- a/htdocs/societe/document.php +++ b/htdocs/societe/document.php @@ -109,7 +109,9 @@ if ($object->id) $totalsize+=$file['size']; } - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/societe/note.php b/htdocs/societe/note.php index 27eb643bc16..e88f94e4287 100644 --- a/htdocs/societe/note.php +++ b/htdocs/societe/note.php @@ -73,7 +73,9 @@ if ($id > 0) dol_fiche_head($head, 'note', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); $cssclass='titlefield'; //if ($action == 'editnote_public') $cssclass='titlefieldcreate'; diff --git a/htdocs/societe/notify/card.php b/htdocs/societe/notify/card.php index b3617a12b27..bc754d8e9a4 100644 --- a/htdocs/societe/notify/card.php +++ b/htdocs/societe/notify/card.php @@ -155,7 +155,9 @@ if ($result > 0) dol_fiche_head($head, 'notify', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php index 4c988603417..9236fc35f6f 100644 --- a/htdocs/societe/price.php +++ b/htdocs/societe/price.php @@ -151,7 +151,9 @@ $head = societe_prepare_head($object); dol_fiche_head($head, 'price', $langs->trans("ThirdParty"), 0, 'company'); -dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); +$linkback = ''.$langs->trans("BackToList").''; + +dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/societe/project.php b/htdocs/societe/project.php index f99bd517975..fe206dd4cc5 100644 --- a/htdocs/societe/project.php +++ b/htdocs/societe/project.php @@ -81,7 +81,9 @@ if ($socid) dol_fiche_head($head, 'project', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/societe/rib.php b/htdocs/societe/rib.php index 1adc9611213..810984a4a40 100644 --- a/htdocs/societe/rib.php +++ b/htdocs/societe/rib.php @@ -285,7 +285,9 @@ if ($socid && $action != 'edit' && $action != "create") print $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$object->id."&ribid=".($ribid?$ribid:$id), $langs->trans("DeleteARib"), $langs->trans("ConfirmDeleteRib", $account->getRibLabel()), "confirm_delete", '', 0, 1); } - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; @@ -486,7 +488,9 @@ if ($socid && $action == 'edit' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; @@ -588,7 +592,9 @@ if ($socid && $action == 'create' && $user->rights->societe->creer) { dol_fiche_head($head, 'rib', $langs->trans("ThirdParty"),0,'company'); - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
'; diff --git a/htdocs/societe/societecontact.php b/htdocs/societe/societecontact.php index 69298f263e8..4ed1852da80 100644 --- a/htdocs/societe/societecontact.php +++ b/htdocs/societe/societecontact.php @@ -149,7 +149,9 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; - dol_banner_tab($object, 'socid', '', ($user->societe_id?0:1), 'rowid', 'nom'); + $linkback = ''.$langs->trans("BackToList").''; + + dol_banner_tab($object, 'socid', $linkback, ($user->societe_id?0:1), 'rowid', 'nom'); print '
';