Merge remote-tracking branch 'upstream/develop' into camelCaps2

This commit is contained in:
Frédéric FRANCE 2018-09-05 18:51:21 +02:00
commit 4e619dd0ed
No known key found for this signature in database
GPG Key ID: 06809324E4B2ABC1
21 changed files with 117 additions and 88 deletions

View File

@ -219,7 +219,7 @@ class AgendaEvents extends DolibarrApi
/** /**
* Update Agenda Event general fields (won't touch lines of expensereport) * Update Agenda Event general fields
* *
* @param int $id Id of Agenda Event to update * @param int $id Id of Agenda Event to update
* @param array $request_data Datas * @param array $request_data Datas
@ -236,20 +236,20 @@ class AgendaEvents extends DolibarrApi
throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); throw new RestException(401, "Insuffisant rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id);
} }
$result = $this->expensereport->fetch($id); $result = $this->actioncomm->fetch($id);
if ( ! $result ) { if ( ! $result ) {
throw new RestException(404, 'expensereport not found'); throw new RestException(404, 'actioncomm not found');
} }
if ( ! DolibarrApi::_checkAccessToResource('expensereport',$this->expensereport->id)) { if ( ! DolibarrApi::_checkAccessToResource('actioncomm',$this->actioncomm->id)) {
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login); throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
} }
foreach($request_data as $field => $value) { foreach($request_data as $field => $value) {
if ($field == 'id') continue; if ($field == 'id') continue;
$this->expensereport->$field = $value; $this->actioncomm->$field = $value;
} }
if ($this->expensereport->update($id, DolibarrApiAccess::$user,1,'','','update')) if ($this->actioncomm->update($id, DolibarrApiAccess::$user,1,'','','update'))
return $this->get($id); return $this->get($id);
return false; return false;

View File

@ -4258,7 +4258,7 @@ class PropaleLigne extends CommonObjectLine
* Update DB line fields total_xxx * Update DB line fields total_xxx
* Used by migration * Used by migration
* *
* @return int <0 if ko, >0 if ok * @return int <0 if KO, >0 if OK
*/ */
function update_total() function update_total()
{ {

View File

@ -4333,9 +4333,10 @@ class OrderLine extends CommonOrderLine
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Update totals of order into database * Update DB line fields total_xxx
* Used by migration
* *
* @return int <0 if ko, >0 if ok * @return int <0 if KO, >0 if OK
*/ */
function update_total() function update_total()
{ {

View File

@ -1680,10 +1680,19 @@ if (empty($reshook))
$error++; $error++;
} }
if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not '' if ($prod_entry_mode == 'free' && empty($idprod) && (($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $price_ht == '') && $price_ht_devise == '') // Unit price can be 0 but not ''
{
if ($price_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
else
{ {
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors'); setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++; $error++;
} }
}
if ($qty == '') { if ($qty == '') {
setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors'); setEventMessages($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Qty')), null, 'errors');
$error++; $error++;
@ -2132,6 +2141,21 @@ if (empty($reshook))
setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors'); setEventMessages($langs->trans('ErrorQtyForCustomerInvoiceCantBeNegative'), null, 'errors');
$error++; $error++;
} }
if (empty($productid) && (($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES)) || $pu_ht == '') && $pu_ht_devise == '') // Unit price can be 0 but not ''
{
if ($pu_ht < 0 && empty($conf->global->FACTURE_ENABLE_NEGATIVE_LINES))
{
$langs->load("errors");
setEventMessages($langs->trans("ErrorFieldCantBeNegativeOnInvoice", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
else
{
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("UnitPriceHT")), null, 'errors');
$error++;
}
}
// Update line // Update line
if (! $error) { if (! $error) {

View File

@ -1209,9 +1209,9 @@ class Facture extends CommonInvoice
$label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency); $label.= '<br><b>' . $langs->trans('AmountHT') . ':</b> ' . price($this->total_ht, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_tva)) if (! empty($this->total_tva))
$label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency); $label.= '<br><b>' . $langs->trans('VAT') . ':</b> ' . price($this->total_tva, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_localtax1)) if (! empty($this->total_localtax1) && $this->total_localtax1 != 0) // We keep test != 0 because $this->total_localtax1 can be '0.00000000'
$label.= '<br><b>' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency); $label.= '<br><b>eee' . $langs->trans('LT1') . ':</b> ' . price($this->total_localtax1, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_localtax2)) if (! empty($this->total_localtax2) && $this->total_localtax2 != 0)
$label.= '<br><b>' . $langs->trans('LT2') . ':</b> ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency); $label.= '<br><b>' . $langs->trans('LT2') . ':</b> ' . price($this->total_localtax2, 0, $langs, 0, -1, -1, $conf->currency);
if (! empty($this->total_ttc)) if (! empty($this->total_ttc))
$label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency); $label.= '<br><b>' . $langs->trans('AmountTTC') . ':</b> ' . price($this->total_ttc, 0, $langs, 0, -1, -1, $conf->currency);
@ -4862,8 +4862,8 @@ class FactureLigne extends CommonInvoiceLine
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
/** /**
* Mise a jour en base des champs total_xxx de ligne de facture * Update DB line fields total_xxx
* TODO What is goal of this method ? * Used by migration
* *
* @return int <0 if KO, >0 if OK * @return int <0 if KO, >0 if OK
*/ */

View File

@ -511,8 +511,9 @@ if (! $sall)
$sql.= ' typent.code,'; $sql.= ' typent.code,';
$sql.= ' state.code_departement, state.nom,'; $sql.= ' state.code_departement, state.nom,';
$sql.= ' country.code,'; $sql.= ' country.code,';
$sql.= " p.rowid, p.ref"; $sql.= " p.rowid, p.ref, p.title";
if ($search_categ_cus) $sql .= ", cc.fk_categorie, cc.fk_soc";
// Add fields from extrafields
foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by foreach ($extrafields->attribute_label as $key => $val) //prevent error with sql_mode=only_full_group_by
{ {
$sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : ''); $sql.=($extrafields->attribute_type[$key] != 'separate' ? ",ef.".$key : '');

View File

@ -154,7 +154,7 @@ $arrayfields=array(
'p.phone'=>array('label'=>"Phone", 'checked'=>1), 'p.phone'=>array('label'=>"Phone", 'checked'=>1),
'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0), 'p.phone_perso'=>array('label'=>"PhonePerso", 'checked'=>0),
'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1), 'p.phone_mobile'=>array('label'=>"PhoneMobile", 'checked'=>1),
'p.fax'=>array('label'=>"Fax", 'checked'=>1), 'p.fax'=>array('label'=>"Fax", 'checked'=>0),
'p.email'=>array('label'=>"EMail", 'checked'=>1), 'p.email'=>array('label'=>"EMail", 'checked'=>1),
'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))), 'p.skype'=>array('label'=>"Skype", 'checked'=>1, 'enabled'=>(! empty($conf->skype->enabled))),
'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)), 'p.thirdparty'=>array('label'=>"ThirdParty", 'checked'=>1, 'enabled'=>empty($conf->global->SOCIETE_DISABLE_CONTACTS)),

View File

@ -523,6 +523,9 @@ class Conf
// By default, we open card if one found // By default, we open card if one found
if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1; if (! isset($this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE)) $this->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE=1;
// By default, we show state code in combo list
if (! isset($this->global->MAIN_SHOW_STATE_CODE)) $this->global->MAIN_SHOW_STATE_CODE=1;
// Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal" // Define list of limited modules (value must be key found for "name" property of module, so for example 'supplierproposal' for Module "Supplier Proposal"
if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later. if (! isset($this->global->MAIN_MODULES_FOR_EXTERNAL)) $this->global->MAIN_MODULES_FOR_EXTERNAL='user,societe,propal,commande,facture,categorie,supplierproposal,fournisseur,contact,projet,contrat,ficheinter,expedition,agenda,resource,adherent,blockedlog'; // '' means 'all'. Note that contact is added here as it should be a module later.
if (! empty($this->modules_parts['moduleforexternal'])) // Module part to include an external module into the MAIN_MODULES_FOR_EXTERNAL list if (! empty($this->modules_parts['moduleforexternal'])) // Module part to include an external module into the MAIN_MODULES_FOR_EXTERNAL list

View File

@ -992,7 +992,7 @@ class DolGraph
var percent=Math.round(series.percent); var percent=Math.round(series.percent);
var number=series.data[0][1]; var number=series.data[0][1];
return \''; return \'';
$this->stringtoshow.='<div style="font-size:8pt;text-align:center;padding:2px;color:black;">'; $this->stringtoshow.='<span style="font-size:8pt;text-align:center;padding:2px;color:black;">';
if ($urltemp) $this->stringtoshow.='<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">'; if ($urltemp) $this->stringtoshow.='<a style="color: #FFFFFF;" border="0" href="'.$urltemp.'">';
$this->stringtoshow.='\'+'; $this->stringtoshow.='\'+';
$this->stringtoshow.=($showlegend?'':'label+\' \'+'); // Hide label if already shown in legend $this->stringtoshow.=($showlegend?'':'label+\' \'+'); // Hide label if already shown in legend
@ -1000,7 +1000,7 @@ class DolGraph
$this->stringtoshow.=($showpercent?'\'<br/>\'+percent+\'%\'+':''); $this->stringtoshow.=($showpercent?'\'<br/>\'+percent+\'%\'+':'');
$this->stringtoshow.='\''; $this->stringtoshow.='\'';
if ($urltemp) $this->stringtoshow.='</a>'; if ($urltemp) $this->stringtoshow.='</a>';
$this->stringtoshow.='</div>\'; $this->stringtoshow.='</span>\';
}, },
background: { background: {
opacity: 0.0, opacity: 0.0,

View File

@ -355,7 +355,7 @@ else
print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit); print_barre_liste($pagetitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'title_setup', 0, $newcardbutton, '', $limit);
print $langs->trans('CronInfo').'<br>'; print '<span class="opacitymedium">'.$langs->trans('CronInfo').'</span><br>';
$text =$langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'<br>'; $text =$langs->trans("HoursOnThisPageAreOnServerTZ").' '.$stringcurrentdate.'<br>';
if (! empty($conf->global->CRON_WARNING_DELAY_HOURS)) $text.=$langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS); if (! empty($conf->global->CRON_WARNING_DELAY_HOURS)) $text.=$langs->trans("WarningCronDelayed", $conf->global->CRON_WARNING_DELAY_HOURS);

View File

@ -147,7 +147,7 @@ class ExpenseReport extends CommonObject
// List of language codes for status // List of language codes for status
$this->statuts_short = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); $this->statuts_short = array(0 => 'Draft', 2 => 'Validated', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused');
$this->statuts = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused'); $this->statuts = array(0 => 'Draft', 2 => 'ValidatedWaitingApproval', 4 => 'Canceled', 5 => 'Approved', 6 => 'Paid', 99 => 'Refused');
$this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut8'); $this->statuts_logo = array(0 => 'statut0', 2 => 'statut1', 4 => 'statut5', 5 => 'statut3', 6 => 'statut6', 99 => 'statut5');
return 1; return 1;
} }

View File

@ -81,7 +81,7 @@ print '</form>';
$sql = "SELECT cp.rowid, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday"; $sql = "SELECT cp.rowid, cp.fk_user, cp.date_debut, cp.date_fin, ct.label, cp.description, cp.halfday";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday cp"; $sql .= " FROM ".MAIN_DB_PREFIX."holiday cp";
$sql .= " LEFT JOIN llx_user u ON cp.fk_user = u.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."user u ON cp.fk_user = u.rowid";
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."c_holiday_types ct ON cp.fk_type = ct.rowid";
$sql .= " WHERE cp.rowid > 0"; $sql .= " WHERE cp.rowid > 0";
$sql .= " AND cp.statut = 3"; // Approved $sql .= " AND cp.statut = 3"; // Approved

View File

@ -221,7 +221,7 @@ if (! empty($conf->holiday->enabled) && $user->rights->holiday->read)
$userstatic->statut=$obj->statut; $userstatic->statut=$obj->statut;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$holidaystatic->getNomUrl(1).'</td>'; print '<td class="nowraponall">'.$holidaystatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(-1, 'leave').'</td>'; print '<td>'.$userstatic->getNomUrl(-1, 'leave').'</td>';
print '<td>'.$typeleaves[$obj->fk_type]['label'].'</td>'; print '<td>'.$typeleaves[$obj->fk_type]['label'].'</td>';
@ -300,7 +300,7 @@ if (! empty($conf->deplacement->enabled) && $user->rights->deplacement->lire)
$userstatic->photo=$obj->photo; $userstatic->photo=$obj->photo;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$deplacementstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall">'.$deplacementstatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(-1).'</td>'; print '<td>'.$userstatic->getNomUrl(-1).'</td>';
print '<td align="right">'.$obj->km.'</td>'; print '<td align="right">'.$obj->km.'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'; print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';
@ -373,7 +373,7 @@ if (! empty($conf->expensereport->enabled) && $user->rights->expensereport->lire
$userstatic->photo=$obj->photo; $userstatic->photo=$obj->photo;
print '<tr class="oddeven">'; print '<tr class="oddeven">';
print '<td>'.$expensereportstatic->getNomUrl(1).'</td>'; print '<td class="nowraponall">'.$expensereportstatic->getNomUrl(1).'</td>';
print '<td>'.$userstatic->getNomUrl(-1).'</td>'; print '<td>'.$userstatic->getNomUrl(-1).'</td>';
print '<td align="right">'.price($obj->total_ttc).'</td>'; print '<td align="right">'.price($obj->total_ttc).'</td>';
print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>'; print '<td align="right">'.dol_print_date($db->jdate($obj->dm),'day').'</td>';

View File

@ -548,8 +548,8 @@ if ($step == 3 && $datatoimport)
print '<input type="hidden" value="'.$format.'" name="format">'; print '<input type="hidden" value="'.$format.'" name="format">';
print '<input type="hidden" value="'.$excludefirstline.'" name="excludefirstline">'; print '<input type="hidden" value="'.$excludefirstline.'" name="excludefirstline">';
print '<input type="hidden" value="'.$endatlinenb.'" name="endatlinenb">'; print '<input type="hidden" value="'.$endatlinenb.'" name="endatlinenb">';
print '<input type="hidden" value="'.$separator.'" name="separator">'; print '<input type="hidden" value="'.dol_escape_htmltag($separator).'" name="separator">';
print '<input type="hidden" value="'.$enclosure.'" name="enclosure">'; print '<input type="hidden" value="'.dol_escape_htmltag($enclosure).'" name="enclosure">';
print '<input type="hidden" value="'.$datatoimport.'" name="datatoimport">'; print '<input type="hidden" value="'.$datatoimport.'" name="datatoimport">';
print '<span class="opacitymedium">'.$langs->trans("ChooseFileToImport",img_picto('','filenew')).'</span><br><br>'; print '<span class="opacitymedium">'.$langs->trans("ChooseFileToImport",img_picto('','filenew')).'</span><br><br>';
@ -648,7 +648,8 @@ if ($step == 4 && $datatoimport)
$classname = "Import".ucfirst($model); $classname = "Import".ucfirst($model);
require_once $dir.$file; require_once $dir.$file;
$obj = new $classname($db,$datatoimport); $obj = new $classname($db,$datatoimport);
if ($model == 'csv') { if ($model == 'csv')
{
$obj->separator = $separator; $obj->separator = $separator;
$obj->enclosure = $enclosure; $obj->enclosure = $enclosure;
} }
@ -796,9 +797,9 @@ if ($step == 4 && $datatoimport)
print '<input type="hidden" value="'.$datatoimport.'" name="datatoimport">'; print '<input type="hidden" value="'.$datatoimport.'" name="datatoimport">';
print '<input type="hidden" value="'.$filetoimport.'" name="filetoimport">'; print '<input type="hidden" value="'.$filetoimport.'" name="filetoimport">';
print $langs->trans("Separator").' : '; print $langs->trans("Separator").' : ';
print '<input type="text" size="1" name="separator" value="'.htmlentities($separator).'"/>'; print '<input type="text" size="1" name="separator" value="'.dol_escape_htmltag($separator).'"/>';
print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : '; print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : ';
print '<input type="text" size="1" name="enclosure" value="'.htmlentities($enclosure).'"/>'; print '<input type="text" size="1" name="enclosure" value="'.dol_escape_htmltag($enclosure).'"/>';
print '<input name="update" type="submit" value="'.$langs->trans('Update').'" class="button" />'; print '<input name="update" type="submit" value="'.$langs->trans('Update').'" class="button" />';
print '</form>'; print '</form>';
print '</td></tr>'; print '</td></tr>';
@ -833,8 +834,8 @@ if ($step == 4 && $datatoimport)
print '<input type="hidden" name="filetoimport" value="'.$filetoimport.'">'; print '<input type="hidden" name="filetoimport" value="'.$filetoimport.'">';
print '<input type="hidden" name="excludefirstline" value="'.$excludefirstline.'">'; print '<input type="hidden" name="excludefirstline" value="'.$excludefirstline.'">';
print '<input type="hidden" name="endatlinenb" value="'.$endatlinenb.'">'; print '<input type="hidden" name="endatlinenb" value="'.$endatlinenb.'">';
print '<input type="hidden" name="separator" value="'.$separator.'">'; print '<input type="hidden" name="separator" value="'.dol_escape_htmltag($separator).'">';
print '<input type="hidden" name="enclosure" value="'.$enclosure.'">'; print '<input type="hidden" name="enclosure" value="'.dol_escape_htmltag($enclosure).'">';
print '<table><tr><td colspan="2" class="opacitymedium">'; print '<table><tr><td colspan="2" class="opacitymedium">';
print $langs->trans("SelectImportFields",img_picto('','grip_title','')).' '; print $langs->trans("SelectImportFields",img_picto('','grip_title','')).' ';
$htmlother->select_import_model($importmodelid,'importmodelid',$datatoimport,1); $htmlother->select_import_model($importmodelid,'importmodelid',$datatoimport,1);
@ -1116,8 +1117,8 @@ if ($step == 4 && $datatoimport)
print '<input type="hidden" name="hexa" value="'.$hexa.'">'; print '<input type="hidden" name="hexa" value="'.$hexa.'">';
print '<input type="hidden" name="excludefirstline" value="'.$excludefirstline.'">'; print '<input type="hidden" name="excludefirstline" value="'.$excludefirstline.'">';
print '<input type="hidden" name="endatlinenb" value="'.$endatlinenb.'">'; print '<input type="hidden" name="endatlinenb" value="'.$endatlinenb.'">';
print '<input type="hidden" value="'.$separator.'" name="separator">'; print '<input type="hidden" value="'.dol_escape_htmltag($separator).'" name="separator">';
print '<input type="hidden" value="'.$enclosure.'" name="enclosure">'; print '<input type="hidden" value="'.dol_escape_htmltag($enclosure).'" name="enclosure">';
print '<table summary="selectofimportprofil" class="noborder" width="100%">'; print '<table summary="selectofimportprofil" class="noborder" width="100%">';
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
@ -1262,10 +1263,8 @@ if ($step == 5 && $datatoimport)
if ($model == 'csv') { if ($model == 'csv') {
print '<tr><td>'.$langs->trans("CsvOptions").'</td>'; print '<tr><td>'.$langs->trans("CsvOptions").'</td>';
print '<td>'; print '<td>';
print $langs->trans("Separator").' : '; print $langs->trans("Separator").' : '.dol_escape_htmltag($separator);
print htmlentities($separator); print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : '.dol_escape_htmltag($enclosure);
print '&nbsp;&nbsp;&nbsp;&nbsp;'.$langs->trans("Enclosure").' : ';
print htmlentities($enclosure);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -60,7 +60,7 @@ DROP TABLE llx_c_accountancy_category;
DROP TABLE llx_c_accountingaccount; DROP TABLE llx_c_accountingaccount;
-- drop old postgresql unique key -- drop old postgresql unique key
-- VPGSQL8.2 DROP INDEX llx_usergroup_rights_fk_usergroup_fk_id_key -- VPGSQL8.2 DROP INDEX llx_usergroup_rights_fk_usergroup_fk_id_key;
update llx_propal set fk_statut = 1 where fk_statut = -1; update llx_propal set fk_statut = 1 where fk_statut = -1;

View File

@ -18,7 +18,7 @@
-- ============================================================================ -- ============================================================================
-- Supprimme orphelins pour permettre montee de la cle -- Delete orphans
-- V4 DELETE llx_commande FROM llx_commande LEFT JOIN llx_societe ON llx_commande.fk_soc = llx_societe.rowid WHERE llx_societe.rowid IS NULL; -- V4 DELETE llx_commande FROM llx_commande LEFT JOIN llx_societe ON llx_commande.fk_soc = llx_societe.rowid WHERE llx_societe.rowid IS NULL;
ALTER TABLE llx_commande ADD UNIQUE INDEX uk_commande_ref (ref, entity); ALTER TABLE llx_commande ADD UNIQUE INDEX uk_commande_ref (ref, entity);

View File

@ -116,6 +116,7 @@ ErrorLoginDoesNotExists=User with login <b>%s</b> could not be found.
ErrorLoginHasNoEmail=This user has no email address. Process aborted. ErrorLoginHasNoEmail=This user has no email address. Process aborted.
ErrorBadValueForCode=Bad value for security code. Try again with new value... ErrorBadValueForCode=Bad value for security code. Try again with new value...
ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative ErrorBothFieldCantBeNegative=Fields %s and %s can't be both negative
ErrorFieldCantBeNegativeOnInvoice=Field <strong>%s</strong> can't be negative on such type of invoice. If you want to add a discount line, just create the discount first with link %s on screen and apply it to invoice. You can also ask your admin to set option FACTURE_ENABLE_NEGATIVE_LINES to 1 to restore old behaviour.
ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative ErrorQtyForCustomerInvoiceCantBeNegative=Quantity for line into customer invoices can't be negative
ErrorWebServerUserHasNotPermission=User account <b>%s</b> used to execute web server has no permission for that ErrorWebServerUserHasNotPermission=User account <b>%s</b> used to execute web server has no permission for that
ErrorNoActivatedBarcode=No barcode type activated ErrorNoActivatedBarcode=No barcode type activated

View File

@ -292,7 +292,7 @@ $listofreferent=array(
'class'=>'SupplierProposal', 'class'=>'SupplierProposal',
'table'=>'supplier_proposal', 'table'=>'supplier_proposal',
'datefieldname'=>'date', 'datefieldname'=>'date',
'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id.'&socid='.$socid, 'urlnew'=>DOL_URL_ROOT.'/supplier_proposal/card.php?action=create&projectid='.$id, // No socid parameter here, the socid is often the customer and we create a supplier object
'lang'=>'supplier_proposal', 'lang'=>'supplier_proposal',
'buttonnew'=>'AddSupplierProposal', 'buttonnew'=>'AddSupplierProposal',
'testnew'=>$user->rights->supplier_proposal->creer, 'testnew'=>$user->rights->supplier_proposal->creer,
@ -565,8 +565,6 @@ print '<td align="right" width="100">'.$langs->trans("AmountHT").'</td>';
print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>'; print '<td align="right" width="100">'.$langs->trans("AmountTTC").'</td>';
print '</tr>'; print '</tr>';
$var = false;
foreach ($listofreferent as $key => $value) foreach ($listofreferent as $key => $value)
{ {
$name=$langs->trans($value['name']); $name=$langs->trans($value['name']);
@ -760,9 +758,9 @@ foreach ($listofreferent as $key => $value)
if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew) if (empty($conf->global->PROJECT_CREATE_ON_OVERVIEW_DISABLED) && $urlnew)
{ {
$addform.='<div class="inline-block valignmiddle">'; $addform.='<div class="inline-block valignmiddle">';
if ($testnew) $addform.='<a class="buttonxxx" href="'.$urlnew.'">'.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).'</a>'; if ($testnew) $addform.='<a class="buttonxxx" href="'.$urlnew.'">'.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' <span class="fa fa-plus-circle valignmiddle"></span></a>';
elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) { elseif (empty($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED)) {
$addform.='<a class="buttonxxx buttonRefused" disabled="disabled" href="#">'.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).'</a>'; $addform.='<a class="buttonxxx buttonRefused" disabled="disabled" href="#">'.($buttonnew?$langs->trans($buttonnew):$langs->trans("Create")).' <span class="fa fa-plus-circle valignmiddle"></span></a>';
} }
$addform.='<div>'; $addform.='<div>';
} }

View File

@ -534,7 +534,7 @@ if ($ispaymentok)
$listofmimes=array(dol_mimetype($file)); $listofmimes=array(dol_mimetype($file));
} }
$result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofnames, $listofmimes, "", "", 0, -1); $result=$object->send_an_email($texttosend, $subjecttosend, $listofpaths, $listofmimes, $listofnames, "", "", 0, -1);
if ($result < 0) if ($result < 0)
{ {
@ -546,6 +546,8 @@ if ($ispaymentok)
{ {
if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)'; if ($file) $postactionmessages[] = 'Email sent to member (with invoice document attached)';
else $postactionmessages[] = 'Email sent to member (without any attached document)'; else $postactionmessages[] = 'Email sent to member (without any attached document)';
// TODO Add actioncomm event
} }
} }
} }

View File

@ -711,48 +711,48 @@ if (! empty($arrayfields['s.nom']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only; if (! empty($search_nom_only) && empty($search_nom)) $search_nom=$search_nom_only;
print '<input class="flat searchstring" type="text" name="search_nom" size="8" value="'.dol_escape_htmltag($search_nom).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_nom" value="'.dol_escape_htmltag($search_nom).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.name_alias']['checked'])) if (! empty($arrayfields['s.name_alias']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" type="text" name="search_alias" size="8" value="'.dol_escape_htmltag($search_alias).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_alias" value="'.dol_escape_htmltag($search_alias).'">';
print '</td>'; print '</td>';
} }
// Barcode // Barcode
if (! empty($arrayfields['s.barcode']['checked'])) if (! empty($arrayfields['s.barcode']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" type="text" name="search_barcode" size="6" value="'.dol_escape_htmltag($search_barcode).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_barcode" value="'.dol_escape_htmltag($search_barcode).'">';
print '</td>'; print '</td>';
} }
// Customer code // Customer code
if (! empty($arrayfields['s.code_client']['checked'])) if (! empty($arrayfields['s.code_client']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="8" type="text" name="search_customer_code" value="'.dol_escape_htmltag($search_customer_code).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_customer_code" value="'.dol_escape_htmltag($search_customer_code).'">';
print '</td>'; print '</td>';
} }
// Supplier code // Supplier code
if (! empty($arrayfields['s.code_fournisseur']['checked'])) if (! empty($arrayfields['s.code_fournisseur']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="8" type="text" name="search_supplier_code" value="'.dol_escape_htmltag($search_supplier_code).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_supplier_code" value="'.dol_escape_htmltag($search_supplier_code).'">';
print '</td>'; print '</td>';
} }
// Account Customer code // Account Customer code
if (! empty($arrayfields['s.code_compta']['checked'])) if (! empty($arrayfields['s.code_compta']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="8" type="text" name="search_account_customer_code" value="'.dol_escape_htmltag($search_account_customer_code).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_account_customer_code" value="'.dol_escape_htmltag($search_account_customer_code).'">';
print '</td>'; print '</td>';
} }
// Account Supplier code // Account Supplier code
if (! empty($arrayfields['s.code_compta_fournisseur']['checked'])) if (! empty($arrayfields['s.code_compta_fournisseur']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat" size="8" type="text" name="search_account_supplier_code" value="'.dol_escape_htmltag($search_account_supplier_code).'">'; print '<input class="flat maxwidth50" type="text" name="search_account_supplier_code" value="'.dol_escape_htmltag($search_account_supplier_code).'">';
print '</td>'; print '</td>';
} }
// Town // Town
@ -766,21 +766,21 @@ if (! empty($arrayfields['s.town']['checked']))
if (! empty($arrayfields['s.zip']['checked'])) if (! empty($arrayfields['s.zip']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_zip" value="'.dol_escape_htmltag($search_zip).'">';
print '</td>'; print '</td>';
} }
// State // State
if (! empty($arrayfields['state.nom']['checked'])) if (! empty($arrayfields['state.nom']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_state" value="'.dol_escape_htmltag($search_state).'">';
print '</td>'; print '</td>';
} }
// Region // Region
if (! empty($arrayfields['region.nom']['checked'])) if (! empty($arrayfields['region.nom']['checked']))
{ {
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_region" value="'.dol_escape_htmltag($search_region).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_region" value="'.dol_escape_htmltag($search_region).'">';
print '</td>'; print '</td>';
} }
// Country // Country
@ -801,14 +801,14 @@ if (! empty($arrayfields['s.email']['checked']))
{ {
// Email // Email
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchemail" size="4" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'">'; print '<input class="flat searchemail maxwidth50" type="text" name="search_email" value="'.dol_escape_htmltag($search_email).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.phone']['checked'])) if (! empty($arrayfields['s.phone']['checked']))
{ {
// Phone // Phone
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_phone" value="'.dol_escape_htmltag($search_phone).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.fax']['checked'])) if (! empty($arrayfields['s.fax']['checked']))
@ -822,14 +822,14 @@ if (! empty($arrayfields['s.url']['checked']))
{ {
// Url // Url
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_url" value="'.dol_escape_htmltag($search_url).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_url" value="'.dol_escape_htmltag($search_url).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.siren']['checked'])) if (! empty($arrayfields['s.siren']['checked']))
{ {
// IdProf1 // IdProf1
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_idprof1" value="'.dol_escape_htmltag($search_idprof1).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_idprof1" value="'.dol_escape_htmltag($search_idprof1).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.siret']['checked'])) if (! empty($arrayfields['s.siret']['checked']))
@ -850,28 +850,28 @@ if (! empty($arrayfields['s.idprof4']['checked']))
{ {
// IdProf4 // IdProf4
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_idprof4" value="'.dol_escape_htmltag($search_idprof4).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_idprof4" value="'.dol_escape_htmltag($search_idprof4).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.idprof5']['checked'])) if (! empty($arrayfields['s.idprof5']['checked']))
{ {
// IdProf5 // IdProf5
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_idprof5" value="'.dol_escape_htmltag($search_idprof5).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_idprof5" value="'.dol_escape_htmltag($search_idprof5).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.idprof6']['checked'])) if (! empty($arrayfields['s.idprof6']['checked']))
{ {
// IdProf6 // IdProf6
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_idprof6" value="'.dol_escape_htmltag($search_idprof6).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_idprof6" value="'.dol_escape_htmltag($search_idprof6).'">';
print '</td>'; print '</td>';
} }
if (! empty($arrayfields['s.tva_intra']['checked'])) if (! empty($arrayfields['s.tva_intra']['checked']))
{ {
// Vat number // Vat number
print '<td class="liste_titre">'; print '<td class="liste_titre">';
print '<input class="flat searchstring" size="4" type="text" name="search_vat" value="'.dol_escape_htmltag($search_vat).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_vat" value="'.dol_escape_htmltag($search_vat).'">';
print '</td>'; print '</td>';
} }
@ -958,7 +958,7 @@ if (! empty($arrayfields['s.status']['checked']))
if (! empty($arrayfields['s.import_key']['checked'])) if (! empty($arrayfields['s.import_key']['checked']))
{ {
print '<td class="liste_titre center">'; print '<td class="liste_titre center">';
print '<input class="flat searchstring" type="text" name="search_import_key" size="3" value="'.dol_escape_htmltag($search_import_key).'">'; print '<input class="flat searchstring maxwidth50" type="text" name="search_import_key" value="'.dol_escape_htmltag($search_import_key).'">';
print '</td>'; print '</td>';
} }
// Action column // Action column