From 4f45ba8ff68a912e7b318b46612d4a2c33683f1f Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 09:56:31 +0200 Subject: [PATCH 1/5] Fix: remove br --- htdocs/core/tpl/objectline_edit.tpl.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php index e2dd75494e9..30354476f56 100644 --- a/htdocs/core/tpl/objectline_edit.tpl.php +++ b/htdocs/core/tpl/objectline_edit.tpl.php @@ -87,8 +87,6 @@ $reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action); } - //echo '
'; // Fix: No reason to start a content of the cells with br - // editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $nbrows=ROWS_2; From 87d44c845df555dfcbe36ba3d72d9dd681e702db Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 11:18:15 +0200 Subject: [PATCH 2/5] Fix: restrict the search in the beginning --- htdocs/comm/list.php | 2 +- htdocs/comm/prospect/list.php | 2 +- htdocs/fourn/liste.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 2572c6391ab..346e7a26b66 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -118,7 +118,7 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'"; -if ($search_zipcode) $sql.= " AND s.cp LIKE '%".$db->escape($search_zipcode)."%'"; +if ($search_zipcode) $sql.= " AND s.cp LIKE '".$db->escape($search_zipcode)."%'"; if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape($search_ville)."%'"; if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'"; if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'"; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 45efe02addd..845d43657a6 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -195,7 +195,7 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ; if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL"; if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape(strtolower($search_nom))."%'"; -if ($search_zipcode) $sql .= " AND s.cp LIKE '%".$db->escape(strtolower($search_zipcode))."%'"; +if ($search_zipcode) $sql .= " AND s.cp LIKE '".$db->escape(strtolower($search_zipcode))."%'"; if ($search_ville) $sql .= " AND s.ville LIKE '%".$db->escape(strtolower($search_ville))."%'"; if ($search_departement) $sql .= " AND d.nom LIKE '%".$db->escape(strtolower($search_departement))."%'"; if ($search_datec) $sql .= " AND s.datec LIKE '%".$db->escape($search_datec)."%'"; diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 6ed18f2392c..2812bba9c7e 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -97,7 +97,7 @@ if ($socname) $sortorder = "ASC"; } if ($search_nom) $sql .= " AND s.nom LIKE '%".$db->escape($search_nom)."%'"; -if ($search_zipcode) $sql .= " AND s.cp LIKE '%".$db->escape($search_zipcode)."%'"; +if ($search_zipcode) $sql .= " AND s.cp LIKE '".$db->escape($search_zipcode)."%'"; if ($search_ville) $sql .= " AND s.ville LIKE '%".$db->escape($search_ville)."%'"; if ($search_code_fournisseur) $sql .= " AND s.code_fournisseur LIKE '%".$db->escape($search_code_fournisseur)."%'"; if ($search_compta_fournisseur) $sql .= " AND s.code_compta_fournisseur LIKE '%".$db->escape($search_compta_fournisseur)."%'"; From 597ba3e6fce173694e4ba0b10bc4d48e3b026850 Mon Sep 17 00:00:00 2001 From: fhenry Date: Wed, 24 Oct 2012 11:37:00 +0200 Subject: [PATCH 3/5] [ task #581 ] Implement function DDLInfoTable for PostgreSQL db class --- htdocs/core/db/pgsql.class.php | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/htdocs/core/db/pgsql.class.php b/htdocs/core/db/pgsql.class.php index 7ed1533ee60..16f02559e28 100644 --- a/htdocs/core/db/pgsql.class.php +++ b/htdocs/core/db/pgsql.class.php @@ -1020,23 +1020,35 @@ class DoliDBPgsql * * @param string $table Name of table * @return array Tableau des informations des champs de la table - * TODO modify for postgresql + * */ function DDLInfoTable($table) { - /* $infotables=array(); - $sql="SHOW FULL COLUMNS FROM ".$table.";"; + $sql="SELECT "; + $sql.=" infcol.column_name as \"Column\","; + $sql.=" CASE WHEN infcol.character_maximum_length IS NOT NULL THEN infcol.udt_name || '('||infcol.character_maximum_length||')'"; + $sql.=" ELSE infcol.udt_name"; + $sql.=" END as \"Type\","; + $sql.=" infcol.collation_name as \"Collation\","; + $sql.=" infcol.is_nullable as \"Null\","; + $sql.=" '' as \"Key\","; + $sql.=" infcol.column_default as \"Default\","; + $sql.=" '' as \"Extra\","; + $sql.=" '' as \"Privileges\""; + $sql.=" FROM information_schema.columns infcol"; + $sql.=" WHERE table_schema='public' "; + $sql.=" AND table_name='".$table."'"; + $sql.=" ORDER BY ordinal_position;"; dol_syslog($sql,LOG_DEBUG); - $result = $this->pg_query($this->db,$sql); + $result = $this->query($sql); while($row = $this->fetch_row($result)) { $infotables[] = $row; - } - return $infotables; - */ + } + return $infotables; } From 382f1a54c3b689b04fb9b7691a1e176e551acfe8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 12:18:40 +0200 Subject: [PATCH 4/5] Fix: add key generator in agenda xcal admin page --- htdocs/admin/agenda_xcal.php | 29 ++++++++++++++--- htdocs/paypal/admin/paypal.php | 58 +++++++++++++++++----------------- 2 files changed, 53 insertions(+), 34 deletions(-) diff --git a/htdocs/admin/agenda_xcal.php b/htdocs/admin/agenda_xcal.php index 14b21de4fc4..151e116f03a 100644 --- a/htdocs/admin/agenda_xcal.php +++ b/htdocs/admin/agenda_xcal.php @@ -1,6 +1,7 @@ * Copyright (C) 2012 Juanjo Menent + * Copyright (C) 2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -51,12 +52,12 @@ if ($actionsave) if ($i >= 3) { $db->commit(); - $mesg = "".$langs->trans("SetupSaved").""; + setEventMessage($langs->trans("SetupSaved")); } else { $db->rollback(); - $mesg = "".$langs->trans("SaveFailed").""; + setEventMessage($langs->trans("SaveFailed"), 'errors'); } } @@ -95,7 +96,10 @@ print ""; print ""; print ''.$langs->trans("PasswordTogetVCalExport").""; -print "global->MAIN_AGENDA_XCAL_EXPORTKEY) . "\" size=\"40\">"; +print ''; +if (! empty($conf->use_javascript_ajax)) + print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); +print ''; print " "; print ""; @@ -147,9 +151,24 @@ $message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'
'; $message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login); print info_admin($message); -dol_htmloutput_mesg($mesg); +if (! empty($conf->use_javascript_ajax)) +{ + print "\n".''; +} -$db->close(); llxFooter(); +$db->close(); ?> diff --git a/htdocs/paypal/admin/paypal.php b/htdocs/paypal/admin/paypal.php index c94d49d4da0..a2911a5b3ef 100644 --- a/htdocs/paypal/admin/paypal.php +++ b/htdocs/paypal/admin/paypal.php @@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin) if (! $error) { $db->commit(); - $mesg='
'.$langs->trans("SetupSaved").'
'; + setEventMessage($langs->trans("SetupSaved")); } else { @@ -100,37 +100,13 @@ dol_fiche_head($head, 'paypalaccount', $langs->trans("ModuleSetup")); print $langs->trans("PaypalDesc")."
\n"; -if ($conf->use_javascript_ajax) -{ - print "\n".''; -} - // Test if php curl exist if (! function_exists('curl_version')) { $langs->load("errors"); - $mesg='
'.$langs->trans("ErrorPhpCurlNotInstalled").'
'; + setEventMessage($langs->trans("ErrorPhpCurlNotInstalled"), 'errors'); } -dol_htmloutput_mesg($mesg); print '
'; print '
'; @@ -235,7 +211,8 @@ $var=!$var; print ''; print $langs->trans("SecurityToken").''; print ''; -print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); +if (! empty($conf->use_javascript_ajax)) + print ' '.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"'); print ''; $var=!$var; @@ -256,7 +233,8 @@ print '

'; // Help doc print ''.$langs->trans("InformationToFindParameters","Paypal").':
'; -if ($conf->use_javascript_ajax) print ''.$langs->trans("ClickHere").'...'; +if (! empty($conf->use_javascript_ajax)) + print ''.$langs->trans("ClickHere").'...'; $realpaypalurl='www.paypal.com'; $sandboxpaypalurl='developer.paypal.com'; @@ -374,7 +352,29 @@ if (! empty($conf->adherent->enabled)) print "
"; print info_admin($langs->trans("YouCanAddTagOnUrl")); -llxFooter(); +if (! empty($conf->use_javascript_ajax)) +{ + print "\n".''; +} + +llxFooter(); $db->close(); ?> From 1c84dbaeec2569d2621a955ea204f27c46e7afca Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 24 Oct 2012 12:27:43 +0200 Subject: [PATCH 5/5] Fix: missing zipcode in url --- htdocs/comm/list.php | 2 +- htdocs/comm/prospect/list.php | 2 +- htdocs/fourn/liste.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php index 346e7a26b66..2f9008cd0ea 100755 --- a/htdocs/comm/list.php +++ b/htdocs/comm/list.php @@ -144,7 +144,7 @@ if ($result) { $num = $db->num_rows($result); - $param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_ville=".$search_ville; + $param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_ville=".$search_ville; if ($search_categ != '') $param.='&search_categ='.$search_categ; if ($search_sale != '') $param.='&search_sale='.$search_sale; diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 845d43657a6..1d06d28db0f 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -244,7 +244,7 @@ if ($resql) llxHeader('',$langs->trans("ThirdParty"),$help_url); } - $param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_ville='.urlencode($search_ville); + $param='&stcomm='.$stcomm.'&search_nom='.urlencode($search_nom).'&search_zipcode='.urlencode($search_code).'&search_ville='.urlencode($search_ville); // Added by Matelli // Store the status filter in the URL if (isSet($search_cstc)) diff --git a/htdocs/fourn/liste.php b/htdocs/fourn/liste.php index 2812bba9c7e..968df23af27 100644 --- a/htdocs/fourn/liste.php +++ b/htdocs/fourn/liste.php @@ -122,7 +122,7 @@ if ($resql) $num = $db->num_rows($resql); $i = 0; - $param = "&search_nom=".$search_nom."&search_code_fournisseur=".$search_code_fournisseur."&search_ville=".$search_ville; + $param = "&search_nom=".$search_nom."&search_code_fournisseur=".$search_code_fournisseur."&search_zipcode=".$search_zipcode."&search_ville=".$search_ville; if ($search_categ != '') $param.='&search_categ='.$search_categ; print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);