2
0
forked from Wavyzz/dolibarr

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

This commit is contained in:
Laurent Destailleur
2013-07-13 15:37:30 +02:00
36 changed files with 138 additions and 143 deletions

0
dev/initdata/generate-commande.php Normal file → Executable file
View File

0
dev/initdata/generate-facture.php Normal file → Executable file
View File

0
dev/initdata/generate-produit.php Normal file → Executable file
View File

4
dev/initdata/generate-propale.php Normal file → Executable file
View File

@@ -143,8 +143,8 @@ while ($i < GEN_NUMBER_PROPAL && $result >= 0)
while ($xnbp < $nbp)
{
$prodid = rand(1, $num_prods);
$product=new Product($db);
$result=$product->fetch($prodids[$prodid]);
$product=new Product($db);
$result=$product->fetch($prodids[$prodid]);
$result=$propal->addline($product->description, $product->price, rand(1,5), 0, 0, 0, $prodids[$prodid], 0);
if ($result < 0)
{

0
dev/initdata/generate-societe.php Normal file → Executable file
View File

View File

@@ -90,7 +90,7 @@ if (! empty($conf->global->GEOIPMAXMIND_COUNTRY_DATAFILE))
}
else
{
if (function_exists('geoip_country_code_by_name')) $geointernal=true;
if (function_exists('geoip_country_code_by_name')) $geointernal=true;
}
// Mode

0
htdocs/admin/pdf.php Executable file → Normal file
View File

0
htdocs/admin/proxy.php Executable file → Normal file
View File

0
htdocs/admin/sms.php Executable file → Normal file
View File

View File

@@ -22,8 +22,8 @@
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/memory.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/geturl.lib.php';
$langs->load("admin");
$langs->load("install");
@@ -55,18 +55,18 @@ print $langs->trans("YouMayFindPerfAdviceHere",'http://wiki.dolibarr.org/index.p
print '<br>';
print '<strong>'.$langs->trans("XDebug").'</strong>: ';
$test=!function_exists('xdebug_is_enabled');
if ($test) print img_picto('','tick.png').' '.$langs->trans("NotInstalled");
if ($test) print img_picto('','tick.png').' '.$langs->trans("NotInstalled");
else
{
print img_picto('','warning').' '.$langs->trans("XDebugInstalled");
print $langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/xdebug.php'.'">XDebug admin page</a>';
}
print '<br>';
}
print '<br>';
// Applicative cache
print '<br>';
print '<strong>'.$langs->trans("ApplicativeCache").'</strong>: ';
$test=!empty($conf->memcached->enabled);
print '<br>';
print '<strong>'.$langs->trans("ApplicativeCache").'</strong>: ';
$test=!empty($conf->memcached->enabled);
if ($test)
{
if (!empty($conf->global->MEMCACHED_SERVER))
@@ -78,28 +78,28 @@ if ($test)
{
print img_picto('','warning').' '.$langs->trans("MemcachedModuleAvailableButNotSetup");
}
}
else print img_picto('','warning').' '.$langs->trans("MemcachedNotAvailable");
}
else print img_picto('','warning').' '.$langs->trans("MemcachedNotAvailable");
print '</br>';
// OPCode cache
print '<br>';
print '<br>';
print '<strong>'.$langs->trans("OPCodeCache").'</strong>: ';
$test1=function_exists('xcache_info');
$test1=function_exists('xcache_info');
if ($test1)
{
print img_picto('','tick.png').' '.$langs->trans("XCacheInstalled");
print $langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/xcache.php'.'">Xcache admin page</a>';
}
print $langs->trans("MoreInformation").' <a href="'.DOL_URL_ROOT.'/admin/xcache.php'.'">Xcache admin page</a>';
}
else
{
$test2=function_exists('eaccelerator_info');
if ($test2) print img_picto('','tick.png').' '.$langs->trans("EAcceleratorInstalled");
else print $langs->trans("NoOPCodeCacheFound");
}
print '<br>';
}
print '<br>';
// HTTPCacheStaticResources
// HTTPCacheStaticResources
print '<script type="text/javascript" language="javascript">
jQuery(document).ready(function() {
var getphpurl;
@@ -360,28 +360,28 @@ print '<div id="httpcachejsphpko">'.img_picto('','warning.png').' '.$langs->tran
print '<br>';
print '<strong>'.$langs->trans("HTTPCacheStaticResources").' - ';
print $langs->trans("CacheByClient").':</strong><br>';
print $langs->trans("TestNotPossibleWithCurrentBrowsers").'<br>';
print $langs->trans("TestNotPossibleWithCurrentBrowsers").'<br>';
// Compressions
print '<br>';
// Compressions
print '<br>';
print '<strong>'.$langs->trans("CompressionOfResources").'</strong>: ';
//$tmp=getURLContent(DOL_URL_ROOT.'/index.php','GET');var_dump($tmp);
print '<br>';
// on PHP
print '<div id="httpcompphpok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'php (.php)').'</div>';
print '<div id="httpcompphpko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'php (.php)').'</div>';
// on rest
print '<div id="httpcompcssok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'css (.css)').'</div>';
print '<div id="httpcompcssko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'css (.css)').'</div>';
print '<div id="httpcompcssphpok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'css (.css.php)').'</div>';
print '<div id="httpcompcssphpko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'css (.css.php)').'</div>';
//print '<div id="httpcompimgok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'img (.png)').'</div>';
//print '<div id="httpcompimgko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'img (.png)').'</div>';
print '<div id="httpcompjsok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'javascript (.js)').'</div>';
print '<div id="httpcompjsko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'javascript (.js)').'</div>';
print '<div id="httpcompjsphpok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'javascript (.js.php)').'</div>';
print '<div id="httpcompjsphpko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'javascript (.js.php)').'</div>';
print '<br>';
// on PHP
print '<div id="httpcompphpok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'php (.php)').'</div>';
print '<div id="httpcompphpko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'php (.php)').'</div>';
// on rest
print '<div id="httpcompcssok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'css (.css)').'</div>';
print '<div id="httpcompcssko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'css (.css)').'</div>';
print '<div id="httpcompcssphpok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'css (.css.php)').'</div>';
print '<div id="httpcompcssphpko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'css (.css.php)').'</div>';
//print '<div id="httpcompimgok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'img (.png)').'</div>';
//print '<div id="httpcompimgko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'img (.png)').'</div>';
print '<div id="httpcompjsok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'javascript (.js)').'</div>';
print '<div id="httpcompjsko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'javascript (.js)').'</div>';
print '<div id="httpcompjsphpok">'.img_picto('','tick.png').' '.$langs->trans("FilesOfTypeCompressed",'javascript (.js.php)').'</div>';
print '<div id="httpcompjsphpko">'.img_picto('','warning.png').' '.$langs->trans("FilesOfTypeNotCompressed",'javascript (.js.php)').'</div>';
// Database driver
print '<br>';
@@ -389,52 +389,52 @@ print '<strong>'.$langs->trans("DriverType").'</strong>: ';
print '<br>';
if ($conf->db->type == 'mysql' || $conf->db->type == 'mysqli')
{
$test=($conf->db->type == 'mysqli');
if ($test)
{
print img_picto('','tick.png').' '.$langs->trans("YouUseBestDriver",$conf->db->type);
}
else
{
$test=($conf->db->type == 'mysqli');
if ($test)
{
print img_picto('','tick.png').' '.$langs->trans("YouUseBestDriver",$conf->db->type);
}
else
{
print img_picto('','warning.png').' '.$langs->trans("YouDoNotUseBestDriver",$conf->db->type,'mysqli');
}
print '<br>';
}
print '<br>';
}
// Product search
print '<br>';
print '<strong>'.$langs->trans("SearchOptim").'</strong>: ';
// Product search
print '<br>';
$tab = array();
$sql = "SELECT COUNT(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$resql=$db->query($sql);
if ($resql)
print '<strong>'.$langs->trans("SearchOptim").'</strong>: ';
print '<br>';
$tab = array();
$sql = "SELECT COUNT(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
$resql=$db->query($sql);
if ($resql)
{
$limitforoptim=10000;
$num=$db->num_rows($resql);
$num=$db->num_rows($resql);
if ($nb > $limitforoptim)
{
if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE))
{
print img_picto('','warning.png').' '.$langs->trans("YouHaveXProductUseSearchOptim",$num);
}
else
{
print img_picto('','tick.png').' '.$langs->trans("YouHaveXProductAndSearchOptimOn",$num);
}
if (empty($conf->global->PRODUCT_DONOTSEARCH_ANYWHERE))
{
print img_picto('','warning.png').' '.$langs->trans("YouHaveXProductUseSearchOptim",$num);
}
else
{
print img_picto('','tick.png').' '.$langs->trans("YouHaveXProductAndSearchOptimOn",$num);
}
}
else
{
print img_picto('','tick.png').' '.$langs->trans("NbOfProductIsLowerThanNoPb",$limitforoptim);
}
print '<br>';
$db->free($resql);
}
$db->free($resql);
}
// Browser
print '<br>';
print '<strong>'.$langs->trans("Browser").'</strong>:<br>';
print '<br>';
print '<strong>'.$langs->trans("Browser").'</strong>:<br>';
if (! in_array($conf->browser->name, array('chrome','opera','safari','firefox')))
{
print img_picto('','warning.png').' '.$langs->trans("BrowserIsKO",$conf->browser->name);
@@ -443,14 +443,14 @@ else
{
print img_picto('','tick.png').' '.$langs->trans("BrowserIsOK",$conf->browser->name);
}
print '<br>';
print '<br>';
// Database statistics update
/*
print '<br>';
print '<strong>'.$langs->trans("DatabaseStatistics").'</strong>: ';
print '<br>';
*/
print '<br>';
print '<strong>'.$langs->trans("DatabaseStatistics").'</strong>: ';
print '<br>';
*/
llxFooter();

0
htdocs/admin/translation.php Executable file → Normal file
View File

0
htdocs/admin/workflow.php Executable file → Normal file
View File

View File

@@ -414,7 +414,6 @@ if ($resql)
print '<td align="right"><b>'.price($total_paid).'</b></td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
}

0
htdocs/core/class/CSMSFile.class.php Executable file → Normal file
View File

0
htdocs/core/class/commondocgenerator.class.php Executable file → Normal file
View File

0
htdocs/core/class/extrafields.class.php Executable file → Normal file
View File

0
htdocs/core/class/genericobject.class.php Executable file → Normal file
View File

0
htdocs/core/class/hookmanager.class.php Executable file → Normal file
View File

View File

@@ -142,10 +142,10 @@ class FormFile
$out .= "\n<!-- End form attach new file -->\n\n";
$parameters = array('socid'=>(isset($GLOBALS['socid'])?$GLOBALS['socid']:''),'id'=>(isset($GLOBALS['id'])?$GLOBALS['id']:''), 'url'=>$url);
$res = $hookmanager->executeHooks('formattachOptions',$parameters,$object);
if (empty($res))
{
print $out;
}
if (empty($res))
{
print $out;
}
print $hookmanager->resprint;
return 1;
@@ -184,8 +184,8 @@ class FormFile
* Return a string to show the box with list of available documents for object.
* This also set the property $this->numoffiles
*
* @param string $modulepart propal, facture, facture_fourn, ...
* @param string $filename Sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete)
* @param string $modulepart Module the files are related to ('propal', 'facture', 'facture_fourn', 'mymodule', 'mymodule_temp', ...)
* @param string $filename Existing (so sanitized) sub-directory to scan (Example: '0/1/10', 'FA/DD/MM/YY/9999'). Use '' if $filedir is already complete)
* @param string $filedir Directory to scan
* @param string $urlsource Url of origin page (for return)
* @param int $genallowed Generation is allowed (1/0 or array list of templates)
@@ -200,9 +200,10 @@ class FormFile
* @param string $title Title to show on top of form
* @param string $buttonlabel Label on submit button
* @param string $codelang Default language code to use on lang combo box if multilang is enabled
* @param string $morepicto Add more HTML content into cell with picto
* @return string Output string with HTML array of documents (might be empty string)
*/
function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='')
function showdocuments($modulepart,$filename,$filedir,$urlsource,$genallowed,$delallowed=0,$modelselected='',$allowgenifempty=1,$forcenomultilang=0,$iconPDF=0,$maxfilenamelength=28,$noform=0,$param='',$title='',$buttonlabel='',$codelang='',$morepicto='')
{
global $langs,$conf,$hookmanager;
global $bc;
@@ -220,7 +221,6 @@ class FormFile
$out='';
$var=true;
//$filename = dol_sanitizeFileName($filename); //Must be sanitized before calling show_documents
$headershown=0;
$showempty=0;
$i=0;
@@ -231,7 +231,7 @@ class FormFile
$out.= "\n".'<!-- Start show_document -->'."\n";
//print 'filedir='.$filedir;
// Affiche en-tete tableau
// Show table
if ($genallowed)
{
$modellist=array();
@@ -390,19 +390,6 @@ class FormFile
$buttonlabeltoshow=$buttonlabel;
if (empty($buttonlabel)) $buttonlabel=$langs->trans('Generate');
// Keep this. Used for test with jmobile
/*print '
<form id="form1" name="form1">
<select id="custom-select2a" name="custom-select2a">
<option value="" data-placeholder="true">Choose One...</option>
<option value="option1">Option #1</option>
<option value="option2">Option #2</option>
<option value="option3">Option #3 - This is a really f fsd f gdfgdgd gd gd gd fgd gd gd fgd fgfdreally really really really long label.</option>
</select>
</form>
';*/
if (empty($noform)) $out.= '<form action="'.$urlsource.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc').'" name="'.$forname.'" id="'.$forname.'_form" method="post">';
$out.= '<input type="hidden" name="action" value="builddoc">';
$out.= '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
@@ -448,7 +435,8 @@ class FormFile
$out.= '</th>';
// Button
$out.= '<th align="center" colspan="'.($delallowed?'2':'1').'" class="formdocbutton liste_titre">';
$addcolumforpicto=($delallowed || $printer || $morepicto);
$out.= '<th align="center" colspan="'.($addcolumforpicto?'2':'1').'" class="formdocbutton liste_titre">';
$genbutton = '<input class="button" id="'.$forname.'_generatebutton"';
$genbutton.= ' type="submit" value="'.$buttonlabel.'"';
if (! $allowgenifempty && ! is_array($modellist) && empty($modellist)) $genbutton.= ' disabled="disabled"';
@@ -462,7 +450,6 @@ class FormFile
$out.= $genbutton;
$out.= '</th>';
if ($printer) $out.= '<th></th>';
if($hookmanager->hooks['formfile'])
{
foreach($hookmanager->hooks['formfile'] as $module)
@@ -524,22 +511,30 @@ class FormFile
$date=(! empty($file['date'])?$file['date']:dol_filemtime($filedir."/".$file["name"]));
$out.= '<td align="right" class="nowrap">'.dol_print_date($date, 'dayhour').'</td>';
if ($delallowed)
if ($delallowed || $printer || $morepicto)
{
$out.= '<td align="right">';
$out.= '<a href="'.$urlsource.(strpos($urlsource,'?')?'&':'?').'action=remove_file&file='.urlencode($relativepath);
$out.= ($param?'&'.$param:'');
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
$out.= '">'.img_delete().'</a></td>';
}
// Printer Icon
if ($printer)
{
$out.= '<td align="right">';
$out.= '&nbsp;<a href="'.$urlsource.'&action=print_file&amp;printer='.$modulepart.'&amp;file='.urlencode($relativepath);
$out.= ($param?'&'.$param:'');
$out.= '">'.img_printer().'</a></td>';
if ($delallowed)
{
$out.= '<a href="'.$urlsource.(strpos($urlsource,'?')?'&':'?').'action=remove_file&file='.urlencode($relativepath);
$out.= ($param?'&'.$param:'');
//$out.= '&modulepart='.$modulepart; // TODO obsolete ?
//$out.= '&urlsource='.urlencode($urlsource); // TODO obsolete ?
$out.= '">'.img_picto($langs->trans("Delete"), 'delete.png').'</a>';
//$out.='</td>';
}
if ($printer)
{
//$out.= '<td align="right">';
$out.= '&nbsp;<a href="'.$urlsource.(strpos($urlsource,'?')?'&':'?').'action=print_file&amp;printer='.$modulepart.'&amp;file='.urlencode($relativepath);
$out.= ($param?'&'.$param:'');
$out.= '">'.img_picto($langs->trans("Print"),'printer.png').'</a>';
}
if ($morepicto)
{
$out.=$morepicto;
}
$out.='</td>';
}
if (is_object($hookmanager))
{

0
htdocs/core/class/html.formsms.class.php Executable file → Normal file
View File

0
htdocs/core/class/rssparser.class.php Executable file → Normal file
View File

0
htdocs/core/class/smtps.class.php Executable file → Normal file
View File

0
htdocs/core/class/vcard.class.php Executable file → Normal file
View File

View File

@@ -1233,7 +1233,7 @@ function dol_most_recent_file($dir,$regexfilter='',$excludefilter=array('\.meta$
/**
* Security check when accessing to a document (used by document.php, viewimage.php and webservices)
*
* @param string $modulepart Module of document
* @param string $modulepart Module of document (module, module_user_temp, module_user or module_temp)
* @param string $original_file Relative path with filename
* @param string $entity Restrict onto entity
* @param User $fuser User object (forced)

View File

View File

View File

@@ -556,20 +556,20 @@ class InterfaceActionsAuto
}
// Projects
elseif ($action == 'PROJECT_CREATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("projects");
$langs->load("agenda");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$ok=1;
elseif ($action == 'PROJECT_CREATE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
$langs->load("other");
$langs->load("projects");
$langs->load("agenda");
$object->actiontypecode='AC_OTH_AUTO';
if (empty($object->actionmsg2)) $object->actionmsg2=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg=$langs->transnoentities("ProjectCreatedInDolibarr",$object->ref);
$object->actionmsg.="\n".$langs->transnoentities("Project").': '.$object->ref;
$object->actionmsg.="\n".$langs->transnoentities("Author").': '.$user->login;
$object->sendtoid=0;
$ok=1;
}
// If not found

View File

View File

0
htdocs/filefunc.inc.php Executable file → Normal file
View File

0
htdocs/fourn/commande/index.php Executable file → Normal file
View File

View File

@@ -125,9 +125,9 @@ if ($resql)
$param="";
if ($search_ref) $param.="&search_ref=".$search_ref;
if ($search_nom) $param.="&search_nom=".$search_nom;
if ($search_user) $param.="&search_user=".$search_user;
if ($search_ttc) $param.="&search_ttc=".$search_ttc;
if ($search_nom) $param.="&search_nom=".$search_nom;
if ($search_user) $param.="&search_user=".$search_user;
if ($search_ttc) $param.="&search_ttc=".$search_ttc;
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num);
print '<form action="'.$_SERVER["PHP_SELF"].'" method="POST">';
print '<table class="noborder" width="100%">';

View File

@@ -1,12 +1,12 @@
# Makefile for generating minified files
.PHONY: all
# we cheat and process all .js files instead of an exhaustive list
all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js)))
%.min.js: %.js
yui-compressor $< -o $@
test:
./node_modules/.bin/jshint *jquery.flot.js
# Makefile for generating minified files
.PHONY: all
# we cheat and process all .js files instead of an exhaustive list
all: $(patsubst %.js,%.min.js,$(filter-out %.min.js,$(wildcard *.js)))
%.min.js: %.js
yui-compressor $< -o $@
test:
./node_modules/.bin/jshint *jquery.flot.js

View File

@@ -83,6 +83,7 @@ if (! empty($dolibarr_main_document_root_alt))
print "Should found something like following examples:<br>\n";
print "\"/extensions\"<br>\n";
print "\"/extensions1,/extensions2,...\"<br>\n";
print "\"/../extensions\"<br>\n";
print "\"/custom\"<br>\n";
exit;
}