Qual: Better compatibility with other databases

This commit is contained in:
Laurent Destailleur 2009-10-29 01:26:38 +00:00
parent 80a876886e
commit 0f4b911f54
5 changed files with 13 additions and 12 deletions

View File

@ -40,7 +40,7 @@ $result = restrictedArea($user, 'societe',$socid,'');
/*
* Affichage page
* View
*/
$commandestatic=new CommandeFournisseur($db);
@ -54,10 +54,7 @@ print_fiche_titre($langs->trans("SuppliersArea"));
print '<table border="0" width="100%" class="notopnoleftnoright">';
print '<tr><td valign="top" width="30%" class="notopnoleft">';
/*
*
*/
// Orders
$commande = new CommandeFournisseur($db);
$sql = "SELECT count(cf.rowid), fk_statut";
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s,";
@ -71,7 +68,7 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
print '<table class="liste" width="100%">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td>'.$langs->trans("Orders").'</td><td align="center">'.$langs->trans("Nb").'</td><td>&nbsp;</td>';
print "</tr>\n";
$var=True;
@ -246,7 +243,7 @@ if ($resql)
$num = $db->num_rows($resql);
$i = 0;
print '<table class="liste" width="100%">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="2">'.$langs->trans("BoxTitleLastSuppliers",min($max,$num))."</td>\n";
print '<td align="right">'.$langs->trans("DateModification")."</td>\n";

View File

@ -244,7 +244,11 @@ class DoliDb
}
}
// Remove () in the tables in FROM
// Remove () in the tables in FROM if one table
$line=preg_replace('/FROM\s*\((([a-z_]+)\s+as\s+([a-z_]+)\s*)\)/i','FROM \\1',$line);
//print $line;
// Remove () in the tables in FROM if two table
//$line=preg_replace('/FROM\s*\((([a-z_]+)\s+as\s+([a-z_]+)\s*,\s*([a-z_]+)\s+as\s+([a-z_]+)\s*)\)/i','FROM \\1',$line);
//print $line;

View File

@ -156,7 +156,7 @@ function show_theme($fuser,$edit=0,$foruserprofile=false)
$var=!$var;
print '<tr '.$bc[$var].'><td colspan="'.$colspan.'">';
print '<table class="notopnoleftnoright" width="100%">';
print '<table class="nobordernopadding" width="100%">';
$handle=opendir($dirtheme);
$i=0;
while (($subdir = readdir($handle))!==false)

View File

@ -66,7 +66,7 @@ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."projet_task as t ON p.rowid = t.fk_projet";
$sql.= " WHERE p.entity = ".$conf->entity;
if ($_REQUEST["mode"]=='mine') $sql.=' AND p.fk_user_resp='.$user->id;
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
$sql.= " GROUP BY p.rowid";
$sql.= " GROUP BY p.title, p.rowid";
$var=true;
$resql = $db->query($sql);
@ -111,7 +111,7 @@ if (!$user->rights->societe->client->voir && !$socid) $sql.= " LEFT JOIN ".MAIN_
$sql.= " WHERE p.entity = ".$conf->entity;
if ($_REQUEST["mode"]=='mine') $sql.=' AND p.fk_user_resp='.$user->id;
if ($socid) $sql.= " AND s.rowid = ".$socid;
$sql.= " GROUP BY s.nom";
$sql.= " GROUP BY s.nom, s.rowid";
//$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
$var=true;

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2005-2008 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2005-2009 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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