Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-10-24 16:25:22 +02:00
commit 0b32b24eba
7 changed files with 78 additions and 49 deletions

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis@dolibarr.fr>
*
* 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 = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
$mesg = "<font class=\"error\">".$langs->trans("SaveFailed")."</font>";
setEventMessage($langs->trans("SaveFailed"), 'errors');
}
}
@ -95,7 +96,10 @@ print "</tr>";
print "<tr class=\"impair\">";
print '<td class="fieldrequired">'.$langs->trans("PasswordTogetVCalExport")."</td>";
print "<td><input required=\"required\" type=\"text\" class=\"flat\" name=\"MAIN_AGENDA_XCAL_EXPORTKEY\" value=\"". (GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')?GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha'):$conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) . "\" size=\"40\"></td>";
print '<td><input required="required" type="text" class="flat" id="MAIN_AGENDA_XCAL_EXPORTKEY" name="MAIN_AGENDA_XCAL_EXPORTKEY" value="' . (GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha')?GETPOST('MAIN_AGENDA_XCAL_EXPORTKEY','alpha'):$conf->global->MAIN_AGENDA_XCAL_EXPORTKEY) . '" size="40">';
if (! empty($conf->use_javascript_ajax))
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
print '</td>';
print "<td>&nbsp;</td>";
print "</tr>";
@ -147,9 +151,24 @@ $message.=$langs->trans("AgendaUrlOptions4",$user->login,$user->login).'<br>';
$message.=$langs->trans("AgendaUrlOptions5",$user->login,$user->login);
print info_admin($message);
dol_htmloutput_mesg($mesg);
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#MAIN_AGENDA_XCAL_EXPORTKEY").val(token);
});
});
});';
print '</script>';
}
$db->close();
llxFooter();
$db->close();
?>

View File

@ -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)."%'";
@ -144,7 +144,7 @@ if ($result)
{
$num = $db->num_rows($result);
$param = "&amp;search_nom=".$search_nom."&amp;search_code=".$search_code."&amp;search_ville=".$search_ville;
$param = "&amp;search_nom=".$search_nom."&amp;search_code=".$search_code."&amp;search_zipcode=".$search_zipcode."&amp;search_ville=".$search_ville;
if ($search_categ != '') $param.='&amp;search_categ='.$search_categ;
if ($search_sale != '') $param.='&amp;search_sale='.$search_sale;

View File

@ -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)."%'";
@ -244,7 +244,7 @@ if ($resql)
llxHeader('',$langs->trans("ThirdParty"),$help_url);
}
$param='&amp;stcomm='.$stcomm.'&amp;search_nom='.urlencode($search_nom).'&amp;search_ville='.urlencode($search_ville);
$param='&amp;stcomm='.$stcomm.'&amp;search_nom='.urlencode($search_nom).'&amp;search_zipcode='.urlencode($search_code).'&amp;search_ville='.urlencode($search_ville);
// Added by Matelli
// Store the status filter in the URL
if (isSet($search_cstc))

View File

@ -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;
}

View File

@ -87,8 +87,6 @@
$reshook=$hookmanager->executeHooks('formEditProductOptions',$parameters,$this,$action);
}
//echo '<br>'; // 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;

View File

@ -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)."%'";
@ -122,7 +122,7 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
$param = "&amp;search_nom=".$search_nom."&amp;search_code_fournisseur=".$search_code_fournisseur."&amp;search_ville=".$search_ville;
$param = "&amp;search_nom=".$search_nom."&amp;search_code_fournisseur=".$search_code_fournisseur."&amp;search_zipcode=".$search_zipcode."&amp;search_ville=".$search_ville;
if ($search_categ != '') $param.='&amp;search_categ='.$search_categ;
print_barre_liste($langs->trans("ListOfSuppliers"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords);

View File

@ -71,7 +71,7 @@ if ($action == 'setvalue' && $user->admin)
if (! $error)
{
$db->commit();
$mesg='<div class="ok">'.$langs->trans("SetupSaved").'</div>';
setEventMessage($langs->trans("SetupSaved"));
}
else
{
@ -100,37 +100,13 @@ dol_fiche_head($head, 'paypalaccount', $langs->trans("ModuleSetup"));
print $langs->trans("PaypalDesc")."<br>\n";
if ($conf->use_javascript_ajax)
{
print "\n".'<script type="text/javascript" language="javascript">';
print '$(document).ready(function () {
$("#apidoc").hide();
$("#apidoca").click(function() {
$("#apidoca").hide();
$("#apidoc").show();
});
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#PAYPAL_SECURITY_TOKEN").val(token);
});
});
});';
print '</script>';
}
// Test if php curl exist
if (! function_exists('curl_version'))
{
$langs->load("errors");
$mesg='<div class="error">'.$langs->trans("ErrorPhpCurlNotInstalled").'</div>';
setEventMessage($langs->trans("ErrorPhpCurlNotInstalled"), 'errors');
}
dol_htmloutput_mesg($mesg);
print '<br>';
print '<form method="post" action="'.$_SERVER["PHP_SELF"].'">';
@ -235,7 +211,8 @@ $var=!$var;
print '<tr '.$bc[$var].'><td>';
print $langs->trans("SecurityToken").'</td><td>';
print '<input size="48" type="text" id="PAYPAL_SECURITY_TOKEN" name="PAYPAL_SECURITY_TOKEN" value="'.$conf->global->PAYPAL_SECURITY_TOKEN.'">';
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
if (! empty($conf->use_javascript_ajax))
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
print '</td></tr>';
$var=!$var;
@ -256,7 +233,8 @@ print '<br><br>';
// Help doc
print '<u>'.$langs->trans("InformationToFindParameters","Paypal").'</u>:<br>';
if ($conf->use_javascript_ajax) print '<a href="#" id="apidoca">'.$langs->trans("ClickHere").'...</a>';
if (! empty($conf->use_javascript_ajax))
print '<a href="#" id="apidoca">'.$langs->trans("ClickHere").'...</a>';
$realpaypalurl='www.paypal.com';
$sandboxpaypalurl='developer.paypal.com';
@ -374,7 +352,29 @@ if (! empty($conf->adherent->enabled))
print "<br>";
print info_admin($langs->trans("YouCanAddTagOnUrl"));
llxFooter();
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#apidoc").hide();
$("#apidoca").click(function() {
$("#apidoca").hide();
$("#apidoc").show();
});
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#PAYPAL_SECURITY_TOKEN").val(token);
});
});
});';
print '</script>';
}
llxFooter();
$db->close();
?>