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

This commit is contained in:
Maxime Kohlhaas 2013-07-13 10:18:51 +02:00
commit 0d1ab71b05
11 changed files with 45 additions and 47 deletions

View File

@ -119,6 +119,8 @@ For users:
- New: [ task #823 ] Shipping_validate email notification.
- New: [ task #900 ] Review code of ficheinter.class.php
- Fix: [Bug #958] LocalTax2 for Spain fails on Suppliers
- Fix: [ bug #972 ] Auto completion contact field do not take account the min caract number before search
- Fix : [ bug #971 ] html.form.class.php select_contact with autocomplete do not exclude id from exclude array
For translators:
- Update language files.

View File

@ -59,4 +59,4 @@ Description: Web based software to manage a small company or foundation
PDF exports,
And a lot of more modules...
.
You can also add third parties external modules or develop yours.
You can also add third parties external modules or develop yours.

View File

@ -126,12 +126,12 @@ print '<br>';
print $langs->trans("NoteOnPathLocation").'<br>';
$url1='http://www.maxmind.com/app/perl?rId=awstats';
$url1='http://www.maxmind.com/en/city?rId=awstats';
print $langs->trans("YouCanDownloadFreeDatFileTo",'<a href="'.$url1.'" target="_blank">'.$url1.'</a>');
print '<br>';
$url2='http://www.maxmind.com/app/perl?rId=awstats';
$url2='http://www.maxmind.com/en/city?rId=awstats';
print $langs->trans("YouCanDownloadAdvancedDatFileTo",'<a href="'.$url2.'" target="_blank">'.$url2.'</a>');
if ($geoip)

View File

@ -639,9 +639,9 @@ class Commande extends CommonOrder
$sql.= ", remise_absolue, remise_percent";
$sql.= ", entity";
$sql.= ")";
$sql.= " VALUES ('(PROV)',".$this->socid.", ".$this->db->idate($now).", ".$user->id;
$sql.= " VALUES ('(PROV)',".$this->socid.", '".$this->db->idate($now)."', ".$user->id;
$sql.= ", ".($this->fk_project?$this->fk_project:"null");
$sql.= ", ".$this->db->idate($date);
$sql.= ", '".$this->db->idate($date)."'";
$sql.= ", ".($this->source>=0 && $this->source != '' ?$this->source:'null');
$sql.= ", '".$this->db->escape($this->note_private)."'";
$sql.= ", '".$this->db->escape($this->note_public)."'";
@ -991,7 +991,7 @@ class Commande extends CommonOrder
$this->fetch($ret);
$this->valid($user);
}
return 1;
return $ret;
}
else return -1;
}

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

View File

@ -971,7 +971,7 @@ class Form
if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $forcecombo && ! $options_only)
{
$out.= ajax_combobox($htmlname, $event);
$out.= ajax_combobox($htmlname, $event, $conf->global->CONTACT_USE_SEARCH_TO_SELECT);
}
if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
@ -2590,6 +2590,7 @@ class Form
$.each(inputok, function(i, inputname) {
var more = "";
if ($("#" + inputname).attr("type") == "checkbox") { more = ":checked"; }
if ($("#" + inputname).attr("type") == "radio") { more = ":checked"; }
var inputvalue = $("#" + inputname + more).val();
if (typeof inputvalue == "undefined") { inputvalue=""; }
options += "&" + inputname + "=" + inputvalue;

View File

@ -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))
{

View File

@ -810,7 +810,7 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
minLength: this.options.minLengthToAutocomplete,
source: function( request, response ) {
var matcher = new RegExp( $.ui.autocomplete.escapeRegex(request.term), "i" );
response( select.children( "option" ).map(function() {
response( select.children( "option:enabled" ).map(function() {
var text = $( this ).text();
if ( this.value && ( !request.term || matcher.test(text) ) )
return {

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

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

View File

@ -250,9 +250,9 @@ $sandboxpaypalurl='developer.paypal.com';
print '<div id="apidoc">';
print 'Your API authentication information can be found with following steps. We recommend that you open a separate Web browser session when carrying out this procedure.<br>
1. Log in to your PayPal Premier or Business account (on real paypal <a href="https://'.$realpaypalurl.'" target="_blank">'.$realpaypalurl.'</a> (or sandbox <a href="https://'.$sandboxpaypalurl.'" target="_blank">'.$sandboxpaypalurl.'</a>).<br>
2. Click the Profile subtab located under the My Account heading.<br>
3. Click the API Access link under the Account Information header.<br>
1. Log in to your PayPal account (on real paypal <a href="https://'.$realpaypalurl.'" target="_blank">'.$realpaypalurl.'</a> (or sandbox <a href="https://'.$sandboxpaypalurl.'" target="_blank">'.$sandboxpaypalurl.'</a>).<br>
2. Click the "Profile" or "Preferencies" subtab located under the My Account heading.<br>
3. Click the link "API Access".<br>
4. Click the View API Certificate link in the right column.<br>
5. Click the Request API signature radio button on the Request API Credentials page.<br>
6. Complete the Request API Credential Request form by clicking the agreement checkbox and clicking Submit.<br>