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

This commit is contained in:
Laurent Destailleur 2013-11-23 14:20:13 +01:00
commit 2cedc7bf2b
2 changed files with 64 additions and 56 deletions

View File

@ -362,30 +362,33 @@ class modAgenda extends DolibarrModules
// Exports // Exports
//-------- //--------
$r=0; $this->export_fields_array[$r]=array('s.rowid'=>"IdCompany",'s.nom'=>'CompanyName','s.address'=>'Address','s.zip'=>'Zip','s.town'=>'Town',
'cp.code'=>'CountryCode','s.phone'=>'Phone','s.siren'=>'ProfId1','s.siret'=>'ProfId2','s.ape'=>'ProfId3','s.idprof4'=>'ProfId4',
$r++; 's.code_compta'=>'CustomerAccountancyCode','s.code_compta_fournisseur'=>'SupplierAccountancyCode','s.tva_intra'=>'VATIntra',
$this->export_code[$r]=$this->rights_class.'_'.$r; 'ac.id'=>"ActionId",'ac.ref_ext'=>"ExternalRef",'ac.datec'=>"ActionDateCreation",'ac.datep'=>"DateActionBegin",
$this->export_label[$r]="ExportDataset_event1"; 'ac.datep2'=>"DateActionEnd",'ac.label'=>"Label",'ac.note'=>"Note",'ac.percent'=>"Percent",'ac.durationp'=>"durationp",
$this->export_permission[$r]=array(array("agenda","export")); 'cac.libelle'=>"ActionType");
$this->export_fields_array[$r]=array('a.id'=>'IdAgenda','a.label'=>'Actions','a.datep'=>'DateActionStart', $this->export_TypeFields_array[$r]=array('s.nom'=>'Text','s.address'=>'Text','s.zip'=>'Text','s.town'=>'Text',
'a.datea'=>'DateActionEnd','a.percent'=>'PercentDone','a.fk_user_author'=>'ActionAskedBy','a.fk_user_action'=>'ActionAffectedTo', 'cp.code'=>'Text','s.phone'=>'Text','s.siren'=>'Text','s.siret'=>'Text','s.ape'=>'Text','s.idprof4'=>'Text',
'a.fk_user_done'=>"ActionDoneBy","a.priority"=>"Priority","a.fulldayevent"=>"EventOnFullDay","a.location"=>"Location", 's.code_compta'=>'Text','s.code_compta_fournisseur'=>'Text','s.tva_intra'=>'Text',
"a.fk_soc"=>"ThirdParty","a.fk_contact"=>"ThirdPartyContact","a.fk_action"=>"Type"); 'ac.ref_ext'=>"Text",'ac.datec'=>"Date",'ac.datep'=>"Date",
'ac.datep2'=>"Date",'ac.label'=>"Text",'ac.note'=>"Text",'ac.percent'=>"Number",
$this->export_TypeFields_array[$r]=array('a.id'=>'Numeric','a.label'=>'Text','a.datep'=>'Date','a.datep2'=>'Date', 'ac.durationp'=>"Duree",
'a.datea'=>'Date','a.datea2'=>'Date','a.percent'=>'Numeric','a.fk_user_author'=>'List:user:name','a.fk_user_action'=>'List:user:name', 'cac.libelle'=>"List:c_actioncomm:libelle:rowid");
'a.fk_user_done'=>"List:user:name","a.priority"=>"Numeric","a.fulldayevent"=>"Boolean","a.location"=>"Text", $this->export_entities_array[$r]=array('s.rowid'=>"company",'s.nom'=>'company','s.address'=>'company','s.zip'=>'company','s.town'=>'company',
"a.fk_soc"=>"List:Societe:nom","a.fk_contact"=>"List:socpeople:name","a.fk_action"=>"List:c_actioncomm:libelle:code"); 'cp.code'=>'company','s.phone'=>'company','s.siren'=>'company','s.siret'=>'company','s.ape'=>'company','s.idprof4'=>'company',
's.code_compta'=>'company','s.code_compta_fournisseur'=>'company','s.tva_intra'=>'company',
$this->export_entities_array[$r]=array('a.id'=>'action','a.label'=>'action','a.datep'=>'action','a.datep2'=>'action', 'ac.id'=>"action",'ac.ref_ext'=>"action",'ac.datec'=>"action",'ac.datep'=>"action",
'a.datea'=>'action','a.datea2'=>'action','a.percent'=>'action','a.fk_user_author'=>'action','a.fk_user_action'=>'action', 'ac.datep2'=>"action",'ac.label'=>"action",'ac.note'=>"action",'ac.percent'=>"action",'ac.durationp'=>"action",
'a.fk_user_done'=>"action","a.priority"=>"action","a.fulldayevent"=>"action","a.location"=>"action", 'cac.libelle'=>"action");
"a.fk_soc"=>"action","a.fk_contact"=>"action","a.fk_action"=>"action");
$this->export_sql_start[$r]='SELECT DISTINCT '; $this->export_sql_start[$r]='SELECT DISTINCT ';
$this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'actioncomm as a'; $this->export_sql_end[$r] =' FROM '.MAIN_DB_PREFIX.'actioncomm as ac';
$this->export_sql_end[$r] .=' Where a.entity = '.$conf->entity; $this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_actioncomm as cac on ac.fk_action = cac.id';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'socpeople as sp on ac.fk_contact = sp.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'societe as s on ac.fk_soc = s.rowid';
$this->export_sql_end[$r] .=' LEFT JOIN '.MAIN_DB_PREFIX.'c_pays as cp on s.fk_pays = cp.rowid';
$this->export_sql_end[$r] .=' Where ac.entity = '.$conf->entity;
$this->export_sql_end[$r] .=' ORDER BY datep'; $this->export_sql_end[$r] .=' ORDER BY datep';
} }

View File

@ -423,40 +423,45 @@ $(document).ready(function() {
}); });
function update_price(input, output) { function update_price(input, output) {
$.post('<?php echo DOL_URL_ROOT; ?>/core/ajax/price.php', { $.ajax({
'amount': $('#' + input).val(), type: 'POST',
'output': output, url: '<?php echo DOL_URL_ROOT; ?>/core/ajax/price.php',
'tva_tx': $('#tva_tx').val() data: {
}, 'amount': $('#' + input).val(),
function(data) { 'output': output,
var addline=false; 'tva_tx': $('#tva_tx').val()
if (typeof data[output] != 'undefined') { },
// Hide price_ttc if no vat success: function(data) {
//if ($('#tva_tx').val() > 0 || ($('#tva_tx').val() == 0 && output == 'price_ht')) { var addline=false;
$('#' + output).val(data[output]); if (typeof data[output] != 'undefined') {
//} // Hide price_ttc if no vat
if ($('#idprod').val() == 0 && $('#select_type').val() >= 0) { //if ($('#tva_tx').val() > 0 || ($('#tva_tx').val() == 0 && output == 'price_ht')) {
if (typeof CKEDITOR == 'object' && typeof CKEDITOR.instances != 'undefined' && CKEDITOR.instances['product_desc'] != 'undefined') { $('#' + output).val(data[output]);
var content = CKEDITOR.instances['product_desc'].getData(); //}
} else { if ($('#idprod').val() == 0 && $('#select_type').val() >= 0) {
var content = $('#product_desc').val(); if (typeof CKEDITOR == 'object' && typeof CKEDITOR.instances != 'undefined' && CKEDITOR.instances['product_desc'] != 'undefined') {
} var content = CKEDITOR.instances['product_desc'].getData();
if (content.length > 0) { } else {
addline=true; var content = $('#product_desc').val();
} }
} else { if (content.length > 0) {
addline=true; addline=true;
} }
} else { } else {
$('#' + input).val(''); addline=true;
$('#' + output).val(''); }
} } else {
if (addline) { $('#' + input).val('');
$('#addlinebutton').removeAttr('disabled'); $('#' + output).val('');
} else { }
$('#addlinebutton').attr('disabled','disabled'); if (addline) {
} $('#addlinebutton').removeAttr('disabled');
}, 'json'); } else {
$('#addlinebutton').attr('disabled','disabled');
}
},
dataType: 'json',
async: false});
} }
function getVATRates(action, htmlname, idprod) { function getVATRates(action, htmlname, idprod) {