Merge remote-tracking branch 'Upstream/develop' into develop-favorite

Resolve conflicts:
	htdocs/install/mysql/migration/3.6.0-3.7.0.sql
This commit is contained in:
aspangaro 2014-10-18 15:32:50 +02:00
commit 9f6a460d42
71 changed files with 602 additions and 343 deletions

View File

@ -272,12 +272,6 @@ source_file = htdocs/langs/en_US/sendings.lang
source_lang = en_US source_lang = en_US
type = MOZILLAPROPERTIES type = MOZILLAPROPERTIES
[dolibarr.shop]
file_filter = htdocs/langs/<lang>/shop.lang
source_file = htdocs/langs/en_US/shop.lang
source_lang = en_US
type = MOZILLAPROPERTIES
[dolibarr.sms] [dolibarr.sms]
file_filter = htdocs/langs/<lang>/sms.lang file_filter = htdocs/langs/<lang>/sms.lang
source_file = htdocs/langs/en_US/sms.lang source_file = htdocs/langs/en_US/sms.lang

View File

@ -122,6 +122,8 @@ For developers:
- New: renamed table llx_c_pays to llx_c_country & libelle field to label. - New: renamed table llx_c_pays to llx_c_country & libelle field to label.
- New: Added hook "formConfirm" and "doActions" for fichinter card - New: Added hook "formConfirm" and "doActions" for fichinter card
- New: Can search list of thirdparties from web service on part of name. - New: Can search list of thirdparties from web service on part of name.
- New: Function getCurrencyAmount is marked as deprecated. Use function price to output a price
including currency symbol.
- Qual: Renamed table llx_c_civilite into llx_c_civility, - Qual: Renamed table llx_c_civilite into llx_c_civility,
field civilite into label in the same table, field civilite into label in the same table,
and field civilite into civility in other table. and field civilite into civility in other table.

View File

@ -25,4 +25,6 @@ then
find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \; find ./htdocs -type f -iname "*.php" -exec chmod a-x {} \;
chmod a+x ./scripts/*/*.php chmod a+x ./scripts/*/*.php
chmod a+x ./scripts/*/*.sh chmod a+x ./scripts/*/*.sh
chmod g-w ./scripts/*/*.php
chmod g-w ./scripts/*/*.sh
fi fi

View File

@ -159,7 +159,7 @@ if ($conf->use_javascript_ajax)
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
print '<tr><td align="center">'; print '<tr '.$bc[0].'><td align="center" colspan="2">';
$SommeA=0; $SommeA=0;
$SommeB=0; $SommeB=0;

View File

@ -387,13 +387,14 @@ if ($id == 11)
$langs->load("bills"); $langs->load("bills");
$langs->load("interventions"); $langs->load("interventions");
$elementList = array( $elementList = array(
'proposal' => $langs->trans('Proposal'), '' => '',
'order' => $langs->trans('Order'), // 'proposal' => $langs->trans('Proposal'),
'invoice' => $langs->trans('Bill'), // 'order' => $langs->trans('Order'),
// 'invoice' => $langs->trans('Bill'),
'invoice_supplier' => $langs->trans('SupplierBill'), 'invoice_supplier' => $langs->trans('SupplierBill'),
'order_supplier' => $langs->trans('SupplierOrder'), 'order_supplier' => $langs->trans('SupplierOrder'),
'intervention' => $langs->trans('InterventionCard'), // 'intervention' => $langs->trans('InterventionCard'),
'contract' => $langs->trans('Contract'), // 'contract' => $langs->trans('Contract'),
'project' => $langs->trans('Project'), 'project' => $langs->trans('Project'),
'project_task' => $langs->trans('Task'), 'project_task' => $langs->trans('Task'),
'agenda' => $langs->trans('Agenda'), 'agenda' => $langs->trans('Agenda'),
@ -402,10 +403,11 @@ if ($id == 11)
'propal' => $langs->trans('Proposal'), 'propal' => $langs->trans('Proposal'),
'commande' => $langs->trans('Order'), 'commande' => $langs->trans('Order'),
'facture' => $langs->trans('Bill'), 'facture' => $langs->trans('Bill'),
'facture_fourn' => $langs->trans('SupplierBill'), // 'facture_fourn' => $langs->trans('SupplierBill'),
'fichinter' => $langs->trans('InterventionCard') 'fichinter' => $langs->trans('InterventionCard')
); );
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty'); if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
asort($elementList);
$sourceList = array( $sourceList = array(
'internal' => $langs->trans('Internal'), 'internal' => $langs->trans('Internal'),
'external' => $langs->trans('External') 'external' => $langs->trans('External')
@ -749,6 +751,7 @@ if ($action == 'delete')
{ {
print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1); print $form->formconfirm($_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.$rowid.'&code='.$_GET["code"].'&id='.$id, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_delete','',0,1);
} }
//var_dump($elementList);
/* /*
* Show a dictionary * Show a dictionary

View File

@ -171,7 +171,7 @@ $nbofentries=(count($data) - 1);
if ($nbofentries > 0) if ($nbofentries > 0)
{ {
print '<tr><td colspan="3">'; print '<tr '.$bc[0].'><td colspan="3">';
tree_recur($data,$data[0],0); tree_recur($data,$data[0],0);
print '</td></tr>'; print '</td></tr>';
} }

View File

@ -1028,7 +1028,7 @@ else // View by day
$today=0; $today=0;
$todayarray=dol_getdate($now,'fast'); $todayarray=dol_getdate($now,'fast');
if ($todayarray['mday']==$day && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1; if ($todayarray['mday']==$day && $todayarray['mon']==$month && $todayarray['year']==$year) $today=1;
if ($today) $style='cal_today'; //if ($today) $style='cal_today';
$timestamp=dol_mktime(12,0,0,$month,$day,$year); $timestamp=dol_mktime(12,0,0,$month,$day,$year);
$arraytimestamp=dol_getdate($timestamp); $arraytimestamp=dol_getdate($timestamp);
@ -1146,11 +1146,11 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa
if (in_array($user->id, $keysofuserassigned)) if (in_array($user->id, $keysofuserassigned))
{ {
$nummytasks++; $cssclass='family_mytasks'; $nummytasks++; $cssclass='family_mytasks';
// TODO Set a color using user color
// Must defined rule to choose color of who to use. // Must defined rule to choose color of who to use.
// event->ownerid will still contains user id of owner // event->ownerid will still contains user id of owner
// event->userassigned will be an array in future. // event->userassigned will be an array in future.
// $color=$user->color; $color=$user->color;
} }
else if ($event->type_code == 'ICALEVENT') else if ($event->type_code == 'ICALEVENT')
{ {

View File

@ -44,6 +44,8 @@ $status=GETPOST("status",'alpha');
$type=GETPOST('type'); $type=GETPOST('type');
$actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':'')); $actioncode=GETPOST("actioncode","alpha",3)?GETPOST("actioncode","alpha",3):(GETPOST("actioncode")=='0'?'0':(empty($conf->global->AGENDA_USE_EVENT_TYPE)?'AC_OTH':''));
$dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear')); $dateselect=dol_mktime(0, 0, 0, GETPOST('dateselectmonth'), GETPOST('dateselectday'), GETPOST('dateselectyear'));
$datestart=dol_mktime(0, 0, 0, GETPOST('datestartmonth'), GETPOST('datestartday'), GETPOST('datestartyear'));
$dateend=dol_mktime(0, 0, 0, GETPOST('dateendmonth'), GETPOST('dateendday'), GETPOST('dateendyear'));
if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE); if ($actioncode == '') $actioncode=(empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE)?'':$conf->global->AGENDA_DEFAULT_FILTER_TYPE);
if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS); if ($status == '' && ! isset($_GET['status']) && ! isset($_POST['status'])) $status=(empty($conf->global->AGENDA_DEFAULT_FILTER_STATUS)?'':$conf->global->AGENDA_DEFAULT_FILTER_STATUS);
@ -123,13 +125,19 @@ if (GETPOST("viewcal") || GETPOST("viewweek") || GETPOST("viewday"))
* View * View
*/ */
$form=new Form($db);
$nav='';
$nav.=' &nbsp; <form name="dateselect" action="'.$_SERVER["PHP_SELF"].'?action=show_peruser'.$param.'">';
$nav.=$form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1);
$nav.=' <input type="submit" name="submitdateselect" class="button" value="'.$langs->trans("Refresh").'">';
$nav.='</form>';
$now=dol_now(); $now=dol_now();
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda'; $help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('',$langs->trans("Agenda"),$help_url); llxHeader('',$langs->trans("Agenda"),$help_url);
$form=new Form($db);
// Define list of all external calendars // Define list of all external calendars
$listofextcals=array(); $listofextcals=array();
@ -188,8 +196,9 @@ if ($filtera > 0 || $filtert > 0 || $filterd > 0 || $usergroup > 0)
if ($usergroup > 0) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup; if ($usergroup > 0) $sql.= ($filtera>0||$filtert>0||$filterd>0?" OR ":"")." ugu.fk_usergroup = ".$usergroup;
$sql.= ")"; $sql.= ")";
} }
//if ($dateselect > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($dateselect)."' AND '".$db->idate($dateselect+3600*24-1).'"'; if ($dateselect > 0) $sql.= " AND a.datep2 >= '".$db->idate($dateselect)."' AND a.datep <= '".$db->idate($dateselect+3600*24-1)."'";
if ($dateselect > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($dateselect)."' AND '".$db->idate($dateselect+3600*24-1)."'"; if ($datestart > 0) $sql.= " AND a.datep BETWEEN '".$db->idate($datestart)."' AND '".$db->idate($datestart+3600*24-1)."'";
if ($dateend > 0) $sql.= " AND a.datep2 BETWEEN '".$db->idate($dateend)."' AND '".$db->idate($dateend+3600*24-1)."'";
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit + 1, $offset); $sql.= $db->plimit($limit + 1, $offset);
//print $sql; //print $sql;
@ -236,7 +245,7 @@ if ($resql)
} }
*/ */
print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param,$sortfield,$sortorder,$link,$num,0,''); print_barre_liste($newtitle, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $link, $num, 0, '', 0, $nav);
//print '<br>'; //print '<br>';
print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?'.$param.'">'."\n"; print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'?'.$param.'">'."\n";
@ -259,9 +268,11 @@ if ($resql)
print '<tr class="liste_titre">'; print '<tr class="liste_titre">';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre" align="center">'; print '<td class="liste_titre" align="center">';
print $form->select_date($dateselect, 'dateselect', 0, 0, 1, '', 1, 0, 1); print $form->select_date($datestart, 'datestart', 0, 0, 1, '', 1, 0, 1);
print '</td>';
print '<td class="liste_titre" align="center">';
print $form->select_date($dateend, 'dateend', 0, 0, 1, '', 1, 0, 1);
print '</td>'; print '</td>';
print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';
print '<td class="liste_titre"></td>'; print '<td class="liste_titre"></td>';

View File

@ -710,6 +710,11 @@ if (! empty($conf->global->AGENDA_USE_EVENT_TYPE))
print '<div style="float: left; padding: 2px; margin-right: 6px;"><div class="peruser_busy" style="width:16px; float: left; margin-right: 4px;">&nbsp;</div>'; print '<div style="float: left; padding: 2px; margin-right: 6px;"><div class="peruser_busy" style="width:16px; float: left; margin-right: 4px;">&nbsp;</div>';
print $langs->trans("Other"); print $langs->trans("Other");
print '</div>'; print '</div>';
/* TODO Show this if at least one cumulated event
print '<div style="float: left; padding: 2px; margin-right: 6px;"><div style="background: #222222; width:16px; float: left; margin-right: 4px;">&nbsp;</div>';
print $langs->trans("SeveralEvents");
print '</div>';
*/
} }
// Add js code to manage click on a box // Add js code to manage click on a box
@ -734,7 +739,7 @@ jQuery(document).ready(function() {
else if (ids.indexOf(",") > -1) /* There is several events */ else if (ids.indexOf(",") > -1) /* There is several events */
{ {
/* alert(\'several events\'); */ /* alert(\'several events\'); */
url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+dateselectday; url = "'.DOL_URL_ROOT.'/comm/action/listactions.php?usertodo="+userid+"&dateselectyear="+year+"&dateselectmonth="+month+"&dateselectday="+day;
window.location.href = url; window.location.href = url;
} }
else /* One event */ else /* One event */

View File

@ -186,7 +186,7 @@ if ($id > 0 || ! empty($ref))
// Si fichier png PDF d'1 page trouve // Si fichier png PDF d'1 page trouve
if (file_exists($fileimage)) if (file_exists($fileimage))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">'; print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($relativepathimage).'">';
} }
// Si fichier png PDF de plus d'1 page trouve // Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis)) elseif (file_exists($fileimagebis))
@ -199,13 +199,12 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview)) if (file_exists($dir_output.$preview))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>'; print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercupropal&file='.urlencode($preview).'"><p>';
} }
} }
} }
print '</div>';
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -206,7 +206,7 @@ if ($id > 0 || ! empty($ref))
// Si fichier png PDF d'1 page trouve // Si fichier png PDF d'1 page trouve
if (file_exists($fileimage)) if (file_exists($fileimage))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($relativepathimage).'">'; print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($relativepathimage).'">';
} }
// Si fichier png PDF de plus d'1 page trouve // Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis)) elseif (file_exists($fileimagebis))
@ -219,13 +219,12 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview)) if (file_exists($dir_output.$preview))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($preview).'"><p>'; print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercucommande&file='.urlencode($preview).'"><p>';
} }
} }
} }
print '</div>';
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -629,8 +629,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) {
} }
} }
else else
{ {
setEventMessage($prodcustprice->error,'errors'); setEventMessage($prodcustprice->error,'errors');
} }
} }

View File

@ -233,7 +233,11 @@ foreach ($accounts as $key=>$type)
$total[$acc->currency_code] += $solde; $total[$acc->currency_code] += $solde;
} }
} }
if (! $found) print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>'; if (! $found)
{
$var = !$var;
print '<tr '.$bc[$var].'><td colspan="6">'.$langs->trans("None").'</td></tr>';
}
// Total // Total
foreach ($total as $key=>$solde) foreach ($total as $key=>$solde)
{ {

View File

@ -398,7 +398,7 @@ if ($id > 0 || ! empty($ref))
// Si fichier png PDF d'1 page trouve // Si fichier png PDF d'1 page trouve
if (file_exists($fileimage)) if (file_exists($fileimage))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($relativepathimage).'">'; print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($relativepathimage).'">';
} }
// Si fichier png PDF de plus d'1 page trouve // Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis)) elseif (file_exists($fileimagebis))
@ -411,12 +411,12 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview)) if (file_exists($dir_output.$preview))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($preview).'"><p>'; print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufacture&file='.urlencode($preview).'"><p>';
} }
} }
} }
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -243,12 +243,12 @@ if (empty($reshook))
{ {
if ($backtopage) if ($backtopage)
{ {
header("Location: ".$backtopage); header("Location: ".$backtopage);
exit; exit;
} }
else else
{ {
header("Location: ".DOL_URL_ROOT.'/contact/list.php'); header("Location: ".DOL_URL_ROOT.'/contact/list.php');
exit; exit;
} }
} }

View File

@ -0,0 +1,52 @@
<?php
/*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/ajax/productonoff.php
* \brief File to set tosell and tobuy for product
*/
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL','1'); // Disables token renewal
if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU','1');
if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML','1');
if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX','1');
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1');
require '../../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php';
$action=GETPOST('action','alpha');
$id=GETPOST('id', 'int');
$value=GETPOST('value', 'int');
$object = new GenericObject($db);
/*
* View
*/
top_httphead();
print '<!-- Ajax page called with url '.$_SERVER["PHP_SELF"].'?'.$_SERVER["QUERY_STRING"].' -->'."\n";
// Registering new values
if (! empty($action) && ! empty($id) && $user->rights->produit->creer) {
if ($action == 'setstatus')
$object->setValueFrom('tosell', $value, 'product', $id);
else if ($action == 'setstatus_buy')
$object->setValueFrom('tobuy', $value, 'product', $id);
}

View File

@ -1747,6 +1747,7 @@ abstract class CommonObject
* @param string $origin Linked element type * @param string $origin Linked element type
* @param int $origin_id Linked element id * @param int $origin_id Linked element id
* @return int <=0 if KO, >0 if OK * @return int <=0 if KO, >0 if OK
* @see fetchObjectLinked, updateObjectLinked, deleteObjectLinked
*/ */
function add_object_linked($origin=null, $origin_id=null) function add_object_linked($origin=null, $origin_id=null)
{ {
@ -1790,6 +1791,7 @@ abstract class CommonObject
* @param string $targettype Object target type * @param string $targettype Object target type
* @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided * @param string $clause 'OR' or 'AND' clause used when both source id and target id are provided
* @return void * @return void
* @see add_object_linked, updateObjectLinked, deleteObjectLinked
*/ */
function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR') function fetchObjectLinked($sourceid='',$sourcetype='',$targetid='',$targettype='',$clause='OR')
{ {
@ -1819,6 +1821,12 @@ abstract class CommonObject
$sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element); $sourcetype = (! empty($sourcetype) ? $sourcetype : $this->element);
$targettype = (! empty($targettype) ? $targettype : $this->element); $targettype = (! empty($targettype) ? $targettype : $this->element);
if (empty($sourceid) && empty($targetid))
{
dol_print_error('','Bad usage of function. No parameter defined and no id defined');
return -1;
}
// Links beetween objects are stored in this table // Links beetween objects are stored in this table
$sql = 'SELECT fk_source, sourcetype, fk_target, targettype'; $sql = 'SELECT fk_source, sourcetype, fk_target, targettype';
$sql.= ' FROM '.MAIN_DB_PREFIX.'element_element'; $sql.= ' FROM '.MAIN_DB_PREFIX.'element_element';
@ -1944,6 +1952,7 @@ abstract class CommonObject
* @param int $targetid Object target id * @param int $targetid Object target id
* @param string $targettype Object target type * @param string $targettype Object target type
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
* @see add_object_linked, fetObjectLinked, deleteObjectLinked
*/ */
function updateObjectLinked($sourceid='', $sourcetype='', $targetid='', $targettype='') function updateObjectLinked($sourceid='', $sourcetype='', $targetid='', $targettype='')
{ {
@ -1989,6 +1998,7 @@ abstract class CommonObject
* @param int $targetid Object target id * @param int $targetid Object target id
* @param string $targettype Object target type * @param string $targettype Object target type
* @return int >0 if OK, <0 if KO * @return int >0 if OK, <0 if KO
* @see add_object_linked, updateObjectLinked, fetchObjectLinked
*/ */
function deleteObjectLinked($sourceid='', $sourcetype='', $targetid='', $targettype='') function deleteObjectLinked($sourceid='', $sourcetype='', $targetid='', $targettype='')
{ {

View File

@ -161,29 +161,29 @@ class HookManager
{ {
//print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."<br>\n"; //print "Before hook ".get_class($actionclassinstance)." method=".$method." hooktype=".$hooktype." results=".count($actionclassinstance->results)." resprints=".count($actionclassinstance->resprints)." resaction=".$resaction." result=".$result."<br>\n";
//print 'class='.get_class($actionclassinstance).' method='.$method.' action='.$action; // jump to next module/class if method does not exists
// jump to next class if method does not exists
if (! method_exists($actionclassinstance,$method)) continue; if (! method_exists($actionclassinstance,$method)) continue;
// test to avoid to run twice a hook, when a module implements several active contexts
// test to avoid to run twice a hook, when a module implements several active contexts
if (in_array($module,$modulealreadyexecuted)) continue; if (in_array($module,$modulealreadyexecuted)) continue;
$modulealreadyexecuted[$module]=$module; // Use the $currentcontext in method for avoid to run twice $modulealreadyexecuted[$module]=$module; // Use the $currentcontext in method for avoid to run twice
// Clean class (an error may have been set into a previous call of another method for same module/hook)
$actionclassinstance->error=0;
$actionclassinstance->errors=array();
// Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return; // Add current context for avoid method execution in bad context, you can add this test in your method : eg if($currentcontext != 'formfile') return;
$parameters['currentcontext'] = $context; $parameters['currentcontext'] = $context;
// Hooks that must return int (hooks with type 'addreplace') // Hooks that must return int (hooks with type 'addreplace')
if ($hooktype == 'addreplace') if ($hooktype == 'addreplace')
{ {
dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG);
$resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) $resaction += $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example)
if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0)) if ($resaction < 0 || ! empty($actionclassinstance->error) || (! empty($actionclassinstance->errors) && count($actionclassinstance->errors) > 0))
{ {
$error++; $error++;
$this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors);
// TODO dead code to remove (do not enable this, but fix hook instead) dol_syslog("Error on hook module=".$module.", method ".$method.", class ".get_class($actionclassinstance).", hooktype=".$hooktype.(empty($this->error)?'':" ".$this->error).(empty($this->errors)?'':" ".join(",",$this->errors)), LOG_ERR);
/* Change must be inside the method of hook if required. Only hook must decide if $action must be modified or not.
if ($method == 'doActions')
{
if ($action=='add') $action='create';
if ($action=='update') $action='edit';
}*/
} }
if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);
@ -195,6 +195,7 @@ class HookManager
// TODO. this should be done into the method of hook by returning nothing // TODO. this should be done into the method of hook by returning nothing
if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue;
//dol_syslog("Call method ".$method." of class ".get_class($actionclassinstance).", module=".$module.", hooktype=".$hooktype, LOG_DEBUG);
$result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example) $result = $actionclassinstance->$method($parameters, $object, $action, $this); // $object and $action can be changed by method ($object->id during creation for example or $action to go back to other action for example)
if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); if (! empty($actionclassinstance->results) && is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results);

View File

@ -194,7 +194,7 @@ class Form
{ {
$ret.='<td align="left">'; $ret.='<td align="left">';
$ret.='<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">'; $ret.='<input type="submit" class="button" name="modify" value="'.$langs->trans("Modify").'">';
$ret.='<br>'."\n"; //$ret.='<br>'."\n";
$ret.='<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">'; $ret.='<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
$ret.='</td>'; $ret.='</td>';
} }
@ -2706,6 +2706,7 @@ class Form
* @param int $maxlength Maximum length for labels * @param int $maxlength Maximum length for labels
* @param int $excludeafterid Exclude all categories after this leaf in category tree. * @param int $excludeafterid Exclude all categories after this leaf in category tree.
* @return void * @return void
* @see select_categories
*/ */
function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0) function select_all_categories($type, $selected='', $htmlname="parent", $maxlength=64, $excludeafterid=0)
{ {

View File

@ -682,22 +682,21 @@ class FormCompany
* @param string $selected Default selected value * @param string $selected Default selected value
* @param string $htmlname HTML select name * @param string $htmlname HTML select name
* @param string $source Source ('internal' or 'external') * @param string $source Source ('internal' or 'external')
* @param string $order Sort criteria * @param string $sortorder Sort criteria
* @param int $showempty 1=Add en empty line * @param int $showempty 1=Add en empty line
* @return void * @return void
*/ */
function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $order='code', $showempty=0) function selectTypeContact($object, $selected, $htmlname = 'type', $source='internal', $sortorder='code', $showempty=0)
{ {
if (is_object($object) && method_exists($object, 'liste_type_contact')) if (is_object($object) && method_exists($object, 'liste_type_contact'))
{ {
$lesTypes = $object->liste_type_contact($source, $order, 0, 1); $lesTypes = $object->liste_type_contact($source, $sortorder, 0, 1);
print '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">'; print '<select class="flat" name="'.$htmlname.'" id="'.$htmlname.'">';
if ($showempty) print '<option value="0"></option>'; if ($showempty) print '<option value="0"></option>';
foreach($lesTypes as $key=>$value) foreach($lesTypes as $key=>$value)
{ {
print '<option value="'.$key.'"'; print '<option value="'.$key.'"';
if ($key == $selected) if ($key == $selected) print ' selected';
print ' selected';
print '>'.$value.'</option>'; print '>'.$value.'</option>';
} }
print "</select>\n"; print "</select>\n";

View File

@ -307,6 +307,7 @@ class FormOther
* @param string $htmlname Name of combo list * @param string $htmlname Name of combo list
* @param int $nocateg Show also an entry "Not categorized" * @param int $nocateg Show also an entry "Not categorized"
* @return string Html combo list code * @return string Html combo list code
* @see select_all_categories
*/ */
function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0) function select_categories($type,$selected=0,$htmlname='search_categ',$nocateg=0)
{ {
@ -318,7 +319,7 @@ class FormOther
$tab_categs = $static_categs->get_full_arbo($type); $tab_categs = $static_categs->get_full_arbo($type);
// Print a select with each of them // Print a select with each of them
$moreforfilter ='<select class="flat" name="'.$htmlname.'">'; $moreforfilter ='<select class="flat" id="select_categ_'.$htmlname.'" name="'.$htmlname.'">';
$moreforfilter.='<option value="">&nbsp;</option>'; // Should use -1 to say nothing $moreforfilter.='<option value="">&nbsp;</option>'; // Should use -1 to say nothing
if (is_array($tab_categs)) if (is_array($tab_categs))

View File

@ -701,6 +701,7 @@ class Translate
* @param string $currency_code Currency Code * @param string $currency_code Currency Code
* @param string $amount If not '', show currency + amount according to langs ($10, 10€). * @param string $amount If not '', show currency + amount according to langs ($10, 10€).
* @return string Amount + Currency symbol encoded into UTF8 * @return string Amount + Currency symbol encoded into UTF8
* @deprecated Use method price to output a price
*/ */
function getCurrencyAmount($currency_code, $amount) function getCurrencyAmount($currency_code, $amount)
{ {

View File

@ -965,6 +965,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql
{ {
//var_dump($objMod->dictionaries['tabname']); //var_dump($objMod->dictionaries['tabname']);
$taborder[] = 0; $taborder[] = 0;
$tabfieldcheck[] = array(); $tabhelp[] = array();
foreach($objMod->dictionaries['tabname'] as $val) foreach($objMod->dictionaries['tabname'] as $val)
{ {
$taborder[] = count($tabname)+1; $taborder[] = count($tabname)+1;
@ -978,7 +979,7 @@ function complete_dictionary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsql
foreach($objMod->dictionaries['tabfieldinsert'] as $val) $tabfieldinsert[] = $val; foreach($objMod->dictionaries['tabfieldinsert'] as $val) $tabfieldinsert[] = $val;
foreach($objMod->dictionaries['tabrowid'] as $val) $tabrowid[] = $val; foreach($objMod->dictionaries['tabrowid'] as $val) $tabrowid[] = $val;
foreach($objMod->dictionaries['tabcond'] as $val) $tabcond[] = $val; foreach($objMod->dictionaries['tabcond'] as $val) $tabcond[] = $val;
foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val; if (! empty($objMod->dictionaries['tabfieldcheck'])) foreach($objMod->dictionaries['tabfieldcheck'] as $val) $tabfieldcheck[] = $val;
if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) $tabhelp[] = $val; if (! empty($objMod->dictionaries['tabhelp'])) foreach($objMod->dictionaries['tabhelp'] as $val) $tabhelp[] = $val;
//foreach($objMod->dictionaries['tabsqlsort'] as $val) $tablib[] = $val; //foreach($objMod->dictionaries['tabsqlsort'] as $val) $tablib[] = $val;
//$tabname = array_merge ($tabname, $objMod->dictionaries['tabname']); //$tabname = array_merge ($tabname, $objMod->dictionaries['tabname']);

View File

@ -459,3 +459,91 @@ function ajax_constantonoff($code, $input=array(), $entity=null, $revertonoff=0,
return $out; return $out;
} }
/**
* On/off button for product tosell or tobuy
*
* @param int $id Id product to set
* @param string $code Name of constant : status or status_buy
* @param array $input Array of type->list of CSS element to switch. Example: array('disabled'=>array(0=>'cssid'))
* @return void
*/
function ajax_productonoff($id, $code, $input=array())
{
require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
global $conf, $langs, $db;
$object = new Product($db);
$object->fetch($id);
$out= '<script type="text/javascript">
$(function() {
var input = '.json_encode($input).';
// Set constant
$("#set_'.$code.'").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/productonoff.php", {
action: \'set'.$code.'\',
value: \'1\',
id: \''.$id.'\'
},
function() {
$("#set_'.$code.'").hide();
$("#del_'.$code.'").show();
// Enable another element
if (input.disabled && input.disabled.length > 0) {
$.each(input.disabled, function(key,value) {
$("#" + value).removeAttr("disabled");
if ($("#" + value).hasClass("butActionRefused") == true) {
$("#" + value).removeClass("butActionRefused");
$("#" + value).addClass("butAction");
}
});
// Show another element
} else if (input.showhide && input.showhide.length > 0) {
$.each(input.showhide, function(key,value) {
$("#" + value).show();
});
}
});
});
// Del constant
$("#del_'.$code.'").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/productonoff.php", {
action: \'set'.$code.'\',
value: \'0\',
id: \''.$id.'\'
},
function() {
$("#del_'.$code.'").hide();
$("#set_'.$code.'").show();
// Disable another element
if (input.disabled && input.disabled.length > 0) {
$.each(input.disabled, function(key,value) {
$("#" + value).attr("disabled", true);
if ($("#" + value).hasClass("butAction") == true) {
$("#" + value).removeClass("butAction");
$("#" + value).addClass("butActionRefused");
}
});
// Hide another element
} else if (input.showhide && input.showhide.length > 0) {
$.each(input.showhide, function(key,value) {
$("#" + value).hide();
});
}
});
});
});
</script>';
if ($code=='status') {
$out.= '<span id="set_'.$code.'" class="linkobject '.($object->$code==1?'hideobject':'').'">'.img_picto($langs->trans("ProductStatusNotOnSell"),'switch_off').'</span>';
$out.= '<span id="del_'.$code.'" class="linkobject '.($object->$code==1?'':'hideobject').'">'.img_picto($langs->trans("ProductStatusOnSell"),'switch_on').'</span>';
}
if ($code=='status_buy') {
$out.= '<span id="set_'.$code.'" class="linkobject '.($object->$code==1?'hideobject':'').'">'.img_picto($langs->trans("ProductStatusNotOnBuy"),'switch_off').'</span>';
$out.= '<span id="del_'.$code.'" class="linkobject '.($object->$code==1?'':'hideobject').'">'.img_picto($langs->trans("ProductStatusOnBuy"),'switch_on').'</span>';
}
return $out;
}

View File

@ -67,7 +67,7 @@ function societe_prepare_head($object)
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES))
{ {
$head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/societe/societecontact.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Contact"); $head[$h][1] = $langs->trans("ContactsAddresses");
$head[$h][2] = 'contact'; $head[$h][2] = 'contact';
$h++; $h++;
} }
@ -110,25 +110,25 @@ function societe_prepare_head($object)
if (! empty($conf->notification->enabled)) if (! empty($conf->notification->enabled))
{ {
$nbNote = 0; $nbNote = 0;
$sql = "SELECT COUNT(n.rowid) as nb"; $sql = "SELECT COUNT(n.rowid) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n"; $sql.= " FROM ".MAIN_DB_PREFIX."notify_def as n";
$sql.= " WHERE fk_soc = ".$object->id; $sql.= " WHERE fk_soc = ".$object->id;
$resql=$db->query($sql); $resql=$db->query($sql);
if ($resql) if ($resql)
{ {
$num = $db->num_rows($resql); $num = $db->num_rows($resql);
$i = 0; $i = 0;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($resql); $obj = $db->fetch_object($resql);
$nbNote=$obj->nb; $nbNote=$obj->nb;
$i++; $i++;
} }
} }
else { else {
dol_print_error($db); dol_print_error($db);
} }
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/societe/notify/card.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Notifications"); $head[$h][1] = $langs->trans("Notifications");
if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')'; if($nbNote > 0) $head[$h][1].= ' ('.$nbNote.')';
@ -492,7 +492,7 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
$projectstatic = new Project($db); $projectstatic = new Project($db);
$i=0; $i=0;
$var=true; $var=false;
while ($i < $num) while ($i < $num)
{ {
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
@ -521,8 +521,9 @@ function show_projects($conf,$langs,$db,$object,$backtopage='')
} }
} }
else else
{ {
print '<tr><td colspan="3">'.$langs->trans("None").'</td></tr>'; $var = false;
print '<tr '.$bc[$var].'><td colspan="4">'.$langs->trans("None").'</td></tr>';
} }
$db->free($result); $db->free($result);
} }
@ -680,7 +681,7 @@ function show_contacts($conf,$langs,$db,$object,$backtopage='')
$result = $db->query($sql); $result = $db->query($sql);
$num = $db->num_rows($result); $num = $db->num_rows($result);
$var=true; $var=false;
if ($num) if ($num)
{ {
$i=0; $i=0;

View File

@ -170,7 +170,7 @@ function dol_shutdown()
* Return value of a param into GET or POST supervariable * Return value of a param into GET or POST supervariable
* *
* @param string $paramname Name of parameter to found * @param string $paramname Name of parameter to found
* @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING, 'custom'= custom filter specify $filter and $options) * @param string $check Type of check (''=no check, 'int'=check it's numeric, 'alpha'=check it's text and sign, 'aZ'=check it's a-z only, 'array'=check it's array, 'san_alpha'= Use filter_var with FILTER_SANITIZE_STRING (do not use this for free text string), 'custom'= custom filter specify $filter and $options)
* @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie) * @param int $method Type of method (0 = get then post, 1 = only get, 2 = only post, 3 = post then get, 4 = post then get then cookie)
* @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails) * @param int $filter Filter to apply when $check is set to custom. (See http://php.net/manual/en/filter.filters.php for détails)
* @param mixed $options Options to pass to filter_var when $check is set to custom * @param mixed $options Options to pass to filter_var when $check is set to custom
@ -453,6 +453,18 @@ function dol_string_nospecial($str,$newstr='_',$badchars='')
return str_replace($forbidden_chars_to_replace,$newstr,str_replace($forbidden_chars_to_remove,"",$str)); return str_replace($forbidden_chars_to_replace,$newstr,str_replace($forbidden_chars_to_remove,"",$str));
} }
/**
* Encode string for xml usage
*
* @param string $string String to encode
* @return string String encoded
*/
function dolEscapeXML($string)
{
return strtr($string, array('\''=>'&apos;','"'=>'&quot;','&'=>'&amp;','<'=>'&lt;','>'=>'&gt;'));
}
/** /**
* Returns text escaped for inclusion into javascript code * Returns text escaped for inclusion into javascript code
* *
@ -658,7 +670,7 @@ function dol_get_fiche_head($links=array(), $active='0', $title='', $notab=0, $p
{ {
$isactive=(is_numeric($active) && $i == $active) || (! is_numeric($active) && $active == $links[$i][2]); $isactive=(is_numeric($active) && $i == $active) || (! is_numeric($active) && $active == $links[$i][2]);
$out.='<div class="inline-block tabsElem'.((! $isactive && ! empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT))?' hideonprint':'').'">'; $out.='<div class="inline-block tabsElem'.($isactive ? ' tabsElemActive' : '').((! $isactive && ! empty($conf->global->MAIN_HIDE_INACTIVETAB_ON_PRINT))?' hideonprint':'').'">';
if (isset($links[$i][2]) && $links[$i][2] == 'image') if (isset($links[$i][2]) && $links[$i][2] == 'image')
{ {
if (!empty($links[$i][0])) if (!empty($links[$i][0]))
@ -2627,10 +2639,11 @@ function load_fiche_titre($titre, $mesg='', $picto='title.png', $pictoisfullpath
* @param int $num number of records found by select with limit+1 * @param int $num number of records found by select with limit+1
* @param int $totalnboflines Total number of records/lines for all pages (if known) * @param int $totalnboflines Total number of records/lines for all pages (if known)
* @param string $picto Icon to use before title (should be a 32x32 transparent png file) * @param string $picto Icon to use before title (should be a 32x32 transparent png file)
* @param int $pictoisfullpath 1=Icon name is a full absolute url of image * @param int $pictoisfullpath 1=Icon name is a full absolute url of image
* @param string $morehtml More html to show
* @return void * @return void
*/ */
function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.png', $pictoisfullpath=0) function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $sortorder='', $center='', $num=-1, $totalnboflines=0, $picto='title.png', $pictoisfullpath=0, $morehtml='')
{ {
global $conf,$langs; global $conf,$langs;
@ -2706,6 +2719,7 @@ function print_barre_liste($titre, $page, $file, $options='', $sortfield='', $so
} }
} }
print_fleche_navigation($page,$file,$options,$nextpage,$pagelist); print_fleche_navigation($page,$file,$options,$nextpage,$pagelist);
if ($morehtml) print $morehtml;
print '</td>'; print '</td>';
print '</tr></table>'."\n"; print '</tr></table>'."\n";
@ -3715,6 +3729,7 @@ function dol_nl2br($stringtoencode,$nl2brmode=0,$forxml=false)
} }
} }
/** /**
* This function is called to encode a string into a HTML string but differs from htmlentities because * This function is called to encode a string into a HTML string but differs from htmlentities because
* all entities but &,<,> are converted. This permits to encode special chars to entities with no double * all entities but &,<,> are converted. This permits to encode special chars to entities with no double

View File

@ -573,17 +573,18 @@ function array2table($data,$tableMarkup=1,$tableoptions='',$troptions='',$tdopti
/** /**
* Return last or next value for a mask (according to area we should not reset) * Return last or next value for a mask (according to area we should not reset)
* *
* @param DoliDB $db Database handler * @param DoliDB $db Database handler
* @param string $mask Mask to use * @param string $mask Mask to use
* @param string $table Table containing field with counter * @param string $table Table containing field with counter
* @param string $field Field containing already used values of counter * @param string $field Field containing already used values of counter
* @param string $where To add a filter on selection (for exemple to filter on invoice types) * @param string $where To add a filter on selection (for exemple to filter on invoice types)
* @param Societe $objsoc The company that own the object we need a counter for * @param Societe $objsoc The company that own the object we need a counter for
* @param string $date Date to use for the {y},{m},{d} tags. * @param string $date Date to use for the {y},{m},{d} tags.
* @param string $mode 'next' for next value or 'last' for last value * @param string $mode 'next' for next value or 'last' for last value
* @return string New value (numeric) or error message * @param bool $bentityon activate the entity filterdefault is true (for modules not compatible with multicompany)
* @return string New value (numeric) or error message
*/ */
function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next') function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$mode='next', $bentityon=true)
{ {
global $conf; global $conf;
@ -784,7 +785,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " FROM ".MAIN_DB_PREFIX.$table;
$sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " WHERE ".$field." LIKE '".$maskLike."'";
$sql.= " AND ".$field." NOT LIKE '%PROV%'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'";
$sql.= " AND entity IN (".getEntity($table, 1).")"; if ($bentityon) // only if entity enable
$sql.= " AND entity IN (".getEntity($table, 1).")";
if ($where) $sql.=$where; if ($where) $sql.=$where;
if ($sqlwhere) $sql.=' AND '.$sqlwhere; if ($sqlwhere) $sql.=' AND '.$sqlwhere;
@ -824,7 +826,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$sql.= " FROM ".MAIN_DB_PREFIX.$table; $sql.= " FROM ".MAIN_DB_PREFIX.$table;
$sql.= " WHERE ".$field." LIKE '".$maskLike."'"; $sql.= " WHERE ".$field." LIKE '".$maskLike."'";
$sql.= " AND ".$field." NOT LIKE '%PROV%'"; $sql.= " AND ".$field." NOT LIKE '%PROV%'";
$sql.= " AND entity IN (".getEntity($table, 1).")"; if ($bentityon) // only if entity enable
$sql.= " AND entity IN (".getEntity($table, 1).")";
if ($where) $sql.=$where; if ($where) $sql.=$where;
if ($sqlwhere) $sql.=' AND '.$sqlwhere; if ($sqlwhere) $sql.=' AND '.$sqlwhere;
@ -877,7 +880,8 @@ function get_next_value($db,$mask,$table,$field,$where='',$objsoc='',$date='',$m
$maskrefclient_sql.= " FROM ".MAIN_DB_PREFIX.$table; $maskrefclient_sql.= " FROM ".MAIN_DB_PREFIX.$table;
//$sql.= " WHERE ".$field." not like '(%'"; //$sql.= " WHERE ".$field." not like '(%'";
$maskrefclient_sql.= " WHERE ".$field." LIKE '".$maskrefclient_maskLike."'"; $maskrefclient_sql.= " WHERE ".$field." LIKE '".$maskrefclient_maskLike."'";
$maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")"; if ($bentityon) // only if entity enable
$maskrefclient_sql.= " AND entity IN (".getEntity($table, 1).")";
if ($where) $maskrefclient_sql.=$where; //use the same optional where as general mask if ($where) $maskrefclient_sql.=$where; //use the same optional where as general mask
if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask if ($sqlwhere) $maskrefclient_sql.=' AND '.$sqlwhere; //use the same sqlwhere as general mask
$maskrefclient_sql.=' AND (SUBSTRING('.$field.', '.(strpos($maskwithnocode,$maskrefclient)+1).', '.dol_strlen($maskrefclient_maskclientcode).")='".$maskrefclient_clientcode."')"; $maskrefclient_sql.=' AND (SUBSTRING('.$field.', '.(strpos($maskwithnocode,$maskrefclient)+1).', '.dol_strlen($maskrefclient_maskclientcode).")='".$maskrefclient_clientcode."')";

View File

@ -334,7 +334,7 @@ class doc_generic_order_odt extends ModelePDFCommandes
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($user,$outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -343,7 +343,7 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array(); $array_propal=is_object($propal_object)?$this->get_substitutionarray_object($propal_object,$outputlangs,'propal'):array();
$array_other=$this->get_substitutionarray_other($user,$outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_propal,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -504,7 +504,7 @@ class doc_generic_project_odt extends ModelePDFProjects
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($user,$outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -490,7 +490,7 @@ class doc_generic_task_odt extends ModelePDFTask
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($project,$outputlangs); $array_objet=$this->get_substitutionarray_object($project,$outputlangs);
$array_other=$this->get_substitutionarray_other($user,$outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -368,7 +368,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs); $array_soc=$this->get_substitutionarray_mysoc($mysoc,$outputlangs);
$array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs); $array_thirdparty=$this->get_substitutionarray_thirdparty($socobject,$outputlangs);
$array_objet=$this->get_substitutionarray_object($object,$outputlangs); $array_objet=$this->get_substitutionarray_object($object,$outputlangs);
$array_other=$this->get_substitutionarray_other($user,$outputlangs); $array_other=$this->get_substitutionarray_other($outputlangs);
$tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other); $tmparray = array_merge($array_user,$array_soc,$array_thirdparty,$array_objet,$array_other);
complete_substitutions_array($tmparray, $outputlangs, $object); complete_substitutions_array($tmparray, $outputlangs, $object);

View File

@ -1,6 +1,6 @@
<?php <?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2011-2012 Juanjo Menent <jmenent@2byte.es>
* *
@ -40,6 +40,11 @@ $ref = GETPOST('ref','alpha');
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'ficheinter', $id, 'fichinter'); $result = restrictedArea($user, 'ficheinter', $id, 'fichinter');
/*
* View
*/
llxHeader(); llxHeader();
$form = new Form($db); $form = new Form($db);
@ -154,6 +159,8 @@ if ($id > 0 || ! empty($ref))
print '</tr>'; print '</tr>';
print '</table>'; print '</table>';
dol_fiche_end();
} }
else else
{ {
@ -165,7 +172,7 @@ if ($id > 0 || ! empty($ref))
// Si fichier png PDF d'1 page trouve // Si fichier png PDF d'1 page trouve
if (file_exists($fileimage)) if (file_exists($fileimage))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufichinter&file='.urlencode($relativepathimage).'">'; print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufichinter&file='.urlencode($relativepathimage).'">';
} }
// Si fichier png PDF de plus d'1 page trouve // Si fichier png PDF de plus d'1 page trouve
elseif (file_exists($fileimagebis)) elseif (file_exists($fileimagebis))
@ -178,13 +185,12 @@ elseif (file_exists($fileimagebis))
if (file_exists($dir_output.$preview)) if (file_exists($dir_output.$preview))
{ {
print '<img src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufichinter&file='.urlencode($preview).'"><p>'; print '<img style="background: #FFF" src="'.DOL_URL_ROOT . '/viewimage.php?modulepart=apercufichinter&file='.urlencode($preview).'"><p>';
} }
} }
} }
print '</div>';
$db->close();
llxFooter(); llxFooter();
$db->close();

View File

@ -49,7 +49,11 @@ $offset = $conf->liste_limit * $page;
$pageprev = $page - 1; $pageprev = $page - 1;
$pagenext = $page + 1; $pagenext = $page + 1;
if (! $sortorder) $sortorder="DESC"; if (! $sortorder) $sortorder="DESC";
if (! $sortfield) $sortfield="fd.date"; if (! $sortfield)
{
if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sortfield="fd.date";
else $sortfield="f.ref";
}
$limit = $conf->liste_limit; $limit = $conf->liste_limit;
$search_ref=GETPOST('search_ref','alpha'); $search_ref=GETPOST('search_ref','alpha');
@ -70,13 +74,12 @@ llxHeader('', $langs->trans("Intervention"));
$sql = "SELECT"; $sql = "SELECT";
$sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,"; $sql.= " f.ref, f.rowid as fichid, f.fk_statut, f.description,";
$sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,"; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " fd.description as descriptiondetail, fd.date as dp, fd.duree,";
$sql.= " s.nom as name, s.rowid as socid, s.client"; $sql.= " s.nom as name, s.rowid as socid, s.client";
$sql.= " FROM (".MAIN_DB_PREFIX."societe as s"; $sql.= " FROM (".MAIN_DB_PREFIX."societe as s";
if (! $user->rights->societe->client->voir && empty($socid)) if (! $user->rights->societe->client->voir && empty($socid)) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
$sql.= ", ".MAIN_DB_PREFIX."fichinter as f)"; $sql.= ", ".MAIN_DB_PREFIX."fichinter as f)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid"; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."fichinterdet as fd ON fd.fk_fichinter = f.rowid";
$sql.= " WHERE f.fk_soc = s.rowid "; $sql.= " WHERE f.fk_soc = s.rowid ";
$sql.= " AND f.entity = ".$conf->entity; $sql.= " AND f.entity = ".$conf->entity;
if ($search_ref) { if ($search_ref) {
@ -86,7 +89,8 @@ if ($search_company) {
$sql .= natural_search('s.nom', $search_company); $sql .= natural_search('s.nom', $search_company);
} }
if ($search_desc) { if ($search_desc) {
$sql .= natural_search(array('f.description', 'fd.description'), $search_desc); if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) $sql .= natural_search(array('f.description', 'fd.description'), $search_desc);
else $sql .= natural_search(array('f.description'), $search_desc);
} }
if ($search_status != '' && $search_status >= 0) { if ($search_status != '' && $search_status >= 0) {
$sql .= ' AND f.fk_statut = '.$search_status; $sql .= ' AND f.fk_statut = '.$search_status;
@ -97,6 +101,7 @@ if ($socid)
$sql.= " AND s.rowid = " . $socid; $sql.= " AND s.rowid = " . $socid;
$sql.= $db->order($sortfield,$sortorder); $sql.= $db->order($sortfield,$sortorder);
$sql.= $db->plimit($limit+1, $offset); $sql.= $db->plimit($limit+1, $offset);
//print $sql;
$result=$db->query($sql); $result=$db->query($sql);
if ($result) if ($result)

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

0
htdocs/holiday/tomergewithdefine_holiday.php Executable file → Normal file
View File

View File

@ -1091,7 +1091,8 @@ ALTER TABLE llx_contrat ADD COLUMN model_pdf varchar(255) DEFAULT NULL AFTER not
ALTER TABLE llx_c_country ADD COLUMN favorite tinyint DEFAULT 0 AFTER active; ALTER TABLE llx_c_country ADD COLUMN favorite tinyint DEFAULT 0 AFTER active;
UPDATE llx_c_country SET favorite = '1' WHERE rowid = '0'; UPDATE llx_c_country SET favorite = '1' WHERE rowid = '0';
ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(label, lang); ALTER TABLE llx_c_email_templates DROP INDEX uk_c_email_templates;
ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(entity, label, lang);
ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template); ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template);
-- Remove OSC module -- Remove OSC module

View File

@ -17,6 +17,6 @@
-- Table with templates of emails -- Table with templates of emails
-- =================================================================== -- ===================================================================
ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(label, lang); ALTER TABLE llx_c_email_templates ADD UNIQUE INDEX uk_c_email_templates(entity, label, lang);
ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template); ALTER TABLE llx_c_email_templates ADD INDEX idx_type(type_template);

View File

@ -89,5 +89,5 @@ ExtSiteUrlAgenda=URL to access .ical file
ExtSiteNoLabel=No Description ExtSiteNoLabel=No Description
WorkingTimeRange=Working time range WorkingTimeRange=Working time range
WorkingDaysRange=Working days range WorkingDaysRange=Working days range
AddEvent=Add event AddEvent=Create event
MyAvailability=My availability MyAvailability=My availability

View File

@ -87,7 +87,7 @@ ClassifyCanceled=Classify 'Abandoned'
ClassifyClosed=Classify 'Closed' ClassifyClosed=Classify 'Closed'
ClassifyUnBilled=Classify 'Unbilled' ClassifyUnBilled=Classify 'Unbilled'
CreateBill=Create Invoice CreateBill=Create Invoice
AddBill=Add invoice or credit note AddBill=Create invoice or credit note
AddToDraftInvoices=Add to draft invoice AddToDraftInvoices=Add to draft invoice
DeleteBill=Delete invoice DeleteBill=Delete invoice
SearchACustomerInvoice=Search for a customer invoice SearchACustomerInvoice=Search for a customer invoice
@ -225,13 +225,13 @@ NonPercuRecuperable=Non-recoverable
SetConditions=Set payment terms SetConditions=Set payment terms
SetMode=Set payment mode SetMode=Set payment mode
Billed=Billed Billed=Billed
RepeatableInvoice=Pre-defined invoice RepeatableInvoice=Template invoice
RepeatableInvoices=Pre-defined invoices RepeatableInvoices=Template invoices
Repeatable=Pre-defined Repeatable=Template
Repeatables=Pre-defined Repeatables=Templates
ChangeIntoRepeatableInvoice=Convert into pre-defined ChangeIntoRepeatableInvoice=Convert into template invoice
CreateRepeatableInvoice=Create pre-defined invoice CreateRepeatableInvoice=Create template invoice
CreateFromRepeatableInvoice=Create from pre-defined invoice CreateFromRepeatableInvoice=Create from template invoice
CustomersInvoicesAndInvoiceLines=Customer invoices and invoice's lines CustomersInvoicesAndInvoiceLines=Customer invoices and invoice's lines
CustomersInvoicesAndPayments=Customer invoices and payments CustomersInvoicesAndPayments=Customer invoices and payments
ExportDataset_invoice_1=Customer invoices list and invoice's lines ExportDataset_invoice_1=Customer invoices list and invoice's lines

View File

@ -9,9 +9,9 @@ Prospect=Prospect
Prospects=Prospects Prospects=Prospects
DeleteAction=Delete an event/task DeleteAction=Delete an event/task
NewAction=New event/task NewAction=New event/task
AddAction=Add event/task AddAction=Create event/task
AddAnAction=Add an event/task AddAnAction=Create an event/task
AddActionRendezVous=Add a Rendez-vous event AddActionRendezVous=Create a Rendez-vous event
Rendez-Vous=Rendezvous Rendez-Vous=Rendezvous
ConfirmDeleteAction=Are you sure you want to delete this event/task ? ConfirmDeleteAction=Are you sure you want to delete this event/task ?
CardAction=Event card CardAction=Event card

View File

@ -259,8 +259,8 @@ AvailableGlobalDiscounts=Absolute discounts available
DiscountNone=None DiscountNone=None
Supplier=Supplier Supplier=Supplier
CompanyList=Company's list CompanyList=Company's list
AddContact=Add contact AddContact=Create contact
AddContactAddress=Add contact/address AddContactAddress=Create contact/address
EditContact=Edit contact EditContact=Edit contact
EditContactAddress=Edit contact/address EditContactAddress=Edit contact/address
Contact=Contact Contact=Contact
@ -268,8 +268,8 @@ ContactsAddresses=Contacts/Addresses
NoContactDefinedForThirdParty=No contact defined for this third party NoContactDefinedForThirdParty=No contact defined for this third party
NoContactDefined=No contact defined NoContactDefined=No contact defined
DefaultContact=Default contact/address DefaultContact=Default contact/address
AddCompany=Add company AddCompany=Create company
AddThirdParty=Add third party AddThirdParty=Create third party
DeleteACompany=Delete a company DeleteACompany=Delete a company
PersonalInformations=Personal data PersonalInformations=Personal data
AccountancyCode=Accountancy code AccountancyCode=Accountancy code
@ -379,8 +379,8 @@ DeliveryAddressLabel=Delivery address label
DeleteDeliveryAddress=Delete a delivery address DeleteDeliveryAddress=Delete a delivery address
ConfirmDeleteDeliveryAddress=Are you sure you want to delete this delivery address? ConfirmDeleteDeliveryAddress=Are you sure you want to delete this delivery address?
NewDeliveryAddress=New delivery address NewDeliveryAddress=New delivery address
AddDeliveryAddress=Add address AddDeliveryAddress=Create address
AddAddress=Add address AddAddress=Create address
NoOtherDeliveryAddress=No alternative delivery address defined NoOtherDeliveryAddress=No alternative delivery address defined
SupplierCategory=Supplier category SupplierCategory=Supplier category
JuridicalStatus200=Independant JuridicalStatus200=Independant

View File

@ -27,7 +27,7 @@ MenuRunningServices=Running services
MenuExpiredServices=Expired services MenuExpiredServices=Expired services
MenuClosedServices=Closed services MenuClosedServices=Closed services
NewContract=New contract NewContract=New contract
AddContract=Add contract AddContract=Create contract
SearchAContract=Search a contract SearchAContract=Search a contract
DeleteAContract=Delete a contract DeleteAContract=Delete a contract
CloseAContract=Close a contract CloseAContract=Close a contract

View File

@ -4,7 +4,7 @@ Donations=Donations
DonationRef=Donation ref. DonationRef=Donation ref.
Donor=Donor Donor=Donor
Donors=Donors Donors=Donors
AddDonation=Add a donation AddDonation=Create a donation
NewDonation=New donation NewDonation=New donation
ShowDonation=Show donation ShowDonation=Show donation
DonationPromise=Gift promise DonationPromise=Gift promise

View File

@ -3,7 +3,7 @@ Intervention=Intervention
Interventions=Interventions Interventions=Interventions
InterventionCard=Intervention card InterventionCard=Intervention card
NewIntervention=New intervention NewIntervention=New intervention
AddIntervention=Add intervention AddIntervention=Create intervention
ListOfInterventions=List of interventions ListOfInterventions=List of interventions
EditIntervention=Edit intervention EditIntervention=Edit intervention
ActionsOnFicheInter=Actions on intervention ActionsOnFicheInter=Actions on intervention

View File

@ -85,7 +85,7 @@ SubscriptionLateShort=Late
SubscriptionNotReceivedShort=Never received SubscriptionNotReceivedShort=Never received
ListOfSubscriptions=List of subscriptions ListOfSubscriptions=List of subscriptions
SendCardByMail=Send card by Email SendCardByMail=Send card by Email
AddMember=Add member AddMember=Create member
NoTypeDefinedGoToSetup=No member types defined. Go to menu "Members types" NoTypeDefinedGoToSetup=No member types defined. Go to menu "Members types"
NewMemberType=New member type NewMemberType=New member type
WelcomeEMail=Welcome e-mail WelcomeEMail=Welcome e-mail
@ -125,7 +125,7 @@ Date=Date
DateAndTime=Date and time DateAndTime=Date and time
PublicMemberCard=Member public card PublicMemberCard=Member public card
MemberNotOrNoMoreExpectedToSubscribe=Member not or no more expected to subscribe MemberNotOrNoMoreExpectedToSubscribe=Member not or no more expected to subscribe
AddSubscription=Add subscription AddSubscription=Create subscription
ShowSubscription=Show subscription ShowSubscription=Show subscription
MemberModifiedInDolibarr=Member modified in Dolibarr MemberModifiedInDolibarr=Member modified in Dolibarr
SendAnEMailToMember=Send information email to member SendAnEMailToMember=Send information email to member

View File

@ -65,7 +65,7 @@ ValidateOrder=Validate order
UnvalidateOrder=Unvalidate order UnvalidateOrder=Unvalidate order
DeleteOrder=Delete order DeleteOrder=Delete order
CancelOrder=Cancel order CancelOrder=Cancel order
AddOrder=Add order AddOrder=Create order
AddToMyOrders=Add to my orders AddToMyOrders=Add to my orders
AddToOtherOrders=Add to other orders AddToOtherOrders=Add to other orders
AddToDraftOrders=Add to draft order AddToDraftOrders=Add to draft order

View File

@ -1,7 +1,6 @@
# Dolibarr language file - Source file is en_US - other # Dolibarr language file - Source file is en_US - other
SecurityCode=Security code SecurityCode=Security code
Calendar=Calendar Calendar=Calendar
AddTrip=Add trip
Tools=Tools Tools=Tools
ToolsDesc=This area is dedicated to group miscellaneous tools not available into other menu entries.<br><br>Those tools can be reached from menu on the side. ToolsDesc=This area is dedicated to group miscellaneous tools not available into other menu entries.<br><br>Those tools can be reached from menu on the side.
Birthday=Birthday Birthday=Birthday

View File

@ -117,12 +117,12 @@ ServiceLimitedDuration=If product is a service with limited duration:
MultiPricesAbility=Several level of prices per product/service MultiPricesAbility=Several level of prices per product/service
MultiPricesNumPrices=Number of prices MultiPricesNumPrices=Number of prices
MultiPriceLevelsName=Price categories MultiPriceLevelsName=Price categories
AssociatedProductsAbility=Activate the virtual products feature AssociatedProductsAbility=Activate the virtual package feature
AssociatedProducts=Virtual product AssociatedProducts=Package product
AssociatedProductsNumber=Number of products composing this virtual product AssociatedProductsNumber=Number of products composing this virtual package product
ParentProductsNumber=Number of parent virtual product ParentProductsNumber=Number of parent packaging product
IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual product IfZeroItIsNotAVirtualProduct=If 0, this product is not a virtual package product
IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual product IfZeroItIsNotUsedByVirtualProduct=If 0, this product is not used by any virtual package product
EditAssociate=Associate EditAssociate=Associate
Translation=Translation Translation=Translation
KeywordFilter=Keyword filter KeywordFilter=Keyword filter
@ -132,7 +132,7 @@ AddDel=Add/Delete
Quantity=Quantity Quantity=Quantity
NoMatchFound=No match found NoMatchFound=No match found
ProductAssociationList=List of related products/services: name of product/service (quantity affected) ProductAssociationList=List of related products/services: name of product/service (quantity affected)
ProductParentList=List of virtual products/services with this product as a component ProductParentList=List of package products/services with this product as a component
ErrorAssociationIsFatherOfThis=One of selected product is parent with current product ErrorAssociationIsFatherOfThis=One of selected product is parent with current product
DeleteProduct=Delete a product/service DeleteProduct=Delete a product/service
ConfirmDeleteProduct=Are you sure you want to delete this product/service? ConfirmDeleteProduct=Are you sure you want to delete this product/service?
@ -179,7 +179,7 @@ CloneProduct=Clone product or service
ConfirmCloneProduct=Are you sure you want to clone product or service <b>%s</b> ? ConfirmCloneProduct=Are you sure you want to clone product or service <b>%s</b> ?
CloneContentProduct=Clone all main informations of product/service CloneContentProduct=Clone all main informations of product/service
ClonePricesProduct=Clone main informations and prices ClonePricesProduct=Clone main informations and prices
CloneCompositionProduct=Clone virtual product/services CloneCompositionProduct=Clone packaged product/services
ProductIsUsed=This product is used ProductIsUsed=This product is used
NewRefForClone=Ref. of new product/service NewRefForClone=Ref. of new product/service
CustomerPrices=Customers prices CustomerPrices=Customers prices

View File

@ -14,7 +14,7 @@ TasksDesc=This view presents all projects and tasks (your user permissions grant
Myprojects=My projects Myprojects=My projects
ProjectsArea=Projects area ProjectsArea=Projects area
NewProject=New project NewProject=New project
AddProject=Add project AddProject=Create project
DeleteAProject=Delete a project DeleteAProject=Delete a project
DeleteATask=Delete a task DeleteATask=Delete a task
ConfirmDeleteAProject=Are you sure you want to delete this project ? ConfirmDeleteAProject=Are you sure you want to delete this project ?
@ -45,7 +45,7 @@ TaskDateStart=Task start date
TaskDateEnd=Task end date TaskDateEnd=Task end date
TaskDescription=Task description TaskDescription=Task description
NewTask=New task NewTask=New task
AddTask=Add task AddTask=Create task
AddDuration=Add duration AddDuration=Add duration
Activity=Activity Activity=Activity
Activities=Tasks/activities Activities=Tasks/activities

View File

@ -16,7 +16,7 @@ Prospect=Prospect
ProspectList=Prospect list ProspectList=Prospect list
DeleteProp=Delete commercial proposal DeleteProp=Delete commercial proposal
ValidateProp=Validate commercial proposal ValidateProp=Validate commercial proposal
AddProp=Add proposal AddProp=Create proposal
ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ? ConfirmDeleteProp=Are you sure you want to delete this commercial proposal ?
ConfirmValidateProp=Are you sure you want to validate this commercial proposal under name <b>%s</b> ? ConfirmValidateProp=Are you sure you want to validate this commercial proposal under name <b>%s</b> ?
LastPropals=Last %s proposals LastPropals=Last %s proposals

View File

@ -10,7 +10,7 @@ NoResourceLinked=No resource linked
ResourcePageIndex=Resources list ResourcePageIndex=Resources list
ResourceSingular=Resource ResourceSingular=Resource
ResourceCard=Resource card ResourceCard=Resource card
AddResource=Add a resource AddResource=Create a resource
ResourceFormLabel_ref=Resource name ResourceFormLabel_ref=Resource name
ResourceType=Resource type ResourceType=Resource type
ResourceFormLabel_description=Resource description ResourceFormLabel_description=Resource description

View File

@ -1,7 +1,7 @@
# Dolibarr language file - Source file is en_US - suppliers # Dolibarr language file - Source file is en_US - suppliers
Suppliers=Suppliers Suppliers=Suppliers
Supplier=Supplier Supplier=Supplier
AddSupplier=Add a supplier AddSupplier=Create a supplier
SupplierRemoved=Supplier removed SupplierRemoved=Supplier removed
SuppliersInvoice=Suppliers invoice SuppliersInvoice=Suppliers invoice
NewSupplier=New supplier NewSupplier=New supplier

View File

@ -4,7 +4,7 @@ Trips=Trips
TripsAndExpenses=Trips and expenses TripsAndExpenses=Trips and expenses
TripsAndExpensesStatistics=Trips and expenses statistics TripsAndExpensesStatistics=Trips and expenses statistics
TripCard=Trip card TripCard=Trip card
AddTrip=Add trip AddTrip=Create trip
ListOfTrips=List of trips ListOfTrips=List of trips
ListOfFees=List of fees ListOfFees=List of fees
NewTrip=New trip NewTrip=New trip

View File

@ -119,4 +119,5 @@ HierarchicView=Hierarchical view
UseTypeFieldToChange=Use field Type to change UseTypeFieldToChange=Use field Type to change
OpenIDURL=OpenID URL OpenIDURL=OpenID URL
LoginUsingOpenID=Use OpenID to login LoginUsingOpenID=Use OpenID to login
WeeklyHours=Weekly hours WeeklyHours=Weekly hours
ColorUser=Color of the user

View File

@ -266,6 +266,7 @@ Afternoon=Tarde
Quadri=Trimestre Quadri=Trimestre
MonthOfDay=Mes del día MonthOfDay=Mes del día
HourShort=H HourShort=H
MinuteShort=min
Rate=Tipo Rate=Tipo
UseLocalTax=Incluir tasas UseLocalTax=Incluir tasas
Bytes=Bytes Bytes=Bytes
@ -679,7 +680,7 @@ ViewPrivateNote=Ver notas
XMoreLines=%s línea(s) ocultas XMoreLines=%s línea(s) ocultas
PublicUrl=URL pública PublicUrl=URL pública
AddBox=Añadir caja AddBox=Añadir caja
SelectElementAndClickRefresh=Seleccione un elemento y haga clic en Refrescar
# Week day # Week day
Monday=Lunes Monday=Lunes
Tuesday=Martes Tuesday=Martes

View File

@ -1420,12 +1420,20 @@ else
// Status (to sell) // Status (to sell)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="2">';
print $object->getLibStatut(2,0); if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) {
print ajax_productonoff($object->id, 'status');
} else {
print $object->getLibStatut(2,0);
}
print '</td></tr>'; print '</td></tr>';
// Status (to buy) // Status (to buy)
print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="2">'; print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="2">';
print $object->getLibStatut(2,1); if (! empty($conf->use_javascript_ajax) && $user->rights->produit->creer) {
print ajax_productonoff($object->id, 'status_buy');
} else {
print $object->getLibStatut(2,1);
}
print '</td></tr>'; print '</td></tr>';
// Batch number management (to batch) // Batch number management (to batch)

View File

@ -173,7 +173,7 @@ if (! empty($conf->categorie->enabled))
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
print '<tr><td align="center">'; print '<tr '.$bc[0].'><td align="center" colspan="2">';
$sql = "SELECT c.label, count(*) as nb"; $sql = "SELECT c.label, count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_product as cs"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_product as cs";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";

View File

@ -292,37 +292,37 @@ if ($id > 0 || ! empty($ref))
// Label // Label
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>'; print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->label.'</td></tr>';
// Date start // Date start
print '<tr><td>'.$langs->trans("DateStart").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("DateStart").'</td><td colspan="3">';
print dol_print_date($object->date_start,'dayhour'); print dol_print_date($object->date_start,'dayhour');
print '</td></tr>'; print '</td></tr>';
// Date end // Date end
print '<tr><td>'.$langs->trans("DateEnd").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("DateEnd").'</td><td colspan="3">';
print dol_print_date($object->date_end,'dayhour'); print dol_print_date($object->date_end,'dayhour');
print '</td></tr>'; print '</td></tr>';
// Planned workload // Planned workload
print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("PlannedWorkload").'</td><td colspan="3">';
print convertSecondToTime($object->planned_workload,'allhourmin'); print convertSecondToTime($object->planned_workload,'allhourmin');
print '</td></tr>'; print '</td></tr>';
// Progress declared // Progress declared
print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ProgressDeclared").'</td><td colspan="3">';
print $object->progress.' %'; print $object->progress.' %';
print '</td></tr>'; print '</td></tr>';
// Progress calculated // Progress calculated
print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">'; print '<tr><td>'.$langs->trans("ProgressCalculated").'</td><td colspan="3">';
if ($object->planned_workload) if ($object->planned_workload)
{ {
$tmparray=$object->getSummaryOfTimeSpent(); $tmparray=$object->getSummaryOfTimeSpent();
if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration']/$object->planned_workload*100, 2).' %'; if ($tmparray['total_duration'] > 0) print round($tmparray['total_duration']/$object->planned_workload*100, 2).' %';
else print '0 %'; else print '0 %';
} }
else print ''; else print '';
print '</td></tr>'; print '</td></tr>';
// Project // Project
if (empty($withproject)) if (empty($withproject))
{ {

0
htdocs/resource/add.php Executable file → Normal file
View File

0
htdocs/resource/card.php Executable file → Normal file
View File

View File

@ -494,10 +494,10 @@ if ($sql_select)
} }
else if (empty($type_element) || $type_element == -1) else if (empty($type_element) || $type_element == -1)
{ {
print '<tr><td colspan="4">'.$langs->trans("SelectElementAndClickRefresh").'</td></tr>'; print '<tr '.$bc[0].'><td colspan="5">'.$langs->trans("SelectElementAndClickRefresh").'</td></tr>';
} }
else { else {
print '<tr><td colspan="4">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>'; print '<tr '.$bc[0].'><td colspan="5">'.$langs->trans("FeatureNotYetAvailable").'</td></tr>';
} }
print "</table>"; print "</table>";

View File

@ -183,7 +183,7 @@ if (! empty($conf->categorie->enabled))
print '<br>'; print '<br>';
print '<table class="noborder" width="100%">'; print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>'; print '<tr class="liste_titre"><th colspan="2">'.$langs->trans("Categories").'</th></tr>';
print '<tr><td align="center">'; print '<tr '.$bc[0].'><td align="center" colspan="2">';
$sql = "SELECT c.label, count(*) as nb"; $sql = "SELECT c.label, count(*) as nb";
$sql.= " FROM ".MAIN_DB_PREFIX."categorie_societe as cs"; $sql.= " FROM ".MAIN_DB_PREFIX."categorie_societe as cs";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cs.fk_categorie = c.rowid";

View File

@ -136,48 +136,48 @@ if (empty($reshook))
{ {
$object->particulier = GETPOST("private"); $object->particulier = GETPOST("private");
$object->name = dolGetFirstLastname(GETPOST('firstname','san_alpha'),GETPOST('nom','san_alpha')?GETPOST('nom','san_alpha'):GETPOST('name','san_alpha')); $object->name = dolGetFirstLastname(GETPOST('firstname','alpha'),GETPOST('nom','alpha')?GETPOST('nom','alpha'):GETPOST('name','alpha'));
$object->civility_id = GETPOST('civility_id', 'int'); $object->civility_id = GETPOST('civility_id', 'int');
// Add non official properties // Add non official properties
$object->name_bis = GETPOST('name','san_alpha')?GETPOST('name','san_alpha'):GETPOST('nom','san_alpha'); $object->name_bis = GETPOST('name','alpha')?GETPOST('name','alpha'):GETPOST('nom','alpha');
$object->firstname = GETPOST('firstname','san_alpha'); $object->firstname = GETPOST('firstname','alpha');
} }
else else
{ {
$object->name = GETPOST('name', 'san_alpha')?GETPOST('name', 'san_alpha'):GETPOST('nom', 'san_alpha'); $object->name = GETPOST('name', 'alpha')?GETPOST('name', 'alpha'):GETPOST('nom', 'alpha');
} }
$object->address = GETPOST('address', 'san_alpha'); $object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'san_alpha'); $object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'san_alpha'); $object->town = GETPOST('town', 'alpha');
$object->country_id = GETPOST('country_id', 'int'); $object->country_id = GETPOST('country_id', 'int');
$object->state_id = GETPOST('state_id', 'int'); $object->state_id = GETPOST('state_id', 'int');
$object->skype = GETPOST('skype', 'san_alpha'); $object->skype = GETPOST('skype', 'alpha');
$object->phone = GETPOST('phone', 'san_alpha'); $object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax','san_alpha'); $object->fax = GETPOST('fax','alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
$object->idprof1 = GETPOST('idprof1', 'san_alpha'); $object->idprof1 = GETPOST('idprof1', 'alpha');
$object->idprof2 = GETPOST('idprof2', 'san_alpha'); $object->idprof2 = GETPOST('idprof2', 'alpha');
$object->idprof3 = GETPOST('idprof3', 'san_alpha'); $object->idprof3 = GETPOST('idprof3', 'alpha');
$object->idprof4 = GETPOST('idprof4', 'san_alpha'); $object->idprof4 = GETPOST('idprof4', 'alpha');
$object->idprof5 = GETPOST('idprof5', 'san_alpha'); $object->idprof5 = GETPOST('idprof5', 'alpha');
$object->idprof6 = GETPOST('idprof6', 'san_alpha'); $object->idprof6 = GETPOST('idprof6', 'alpha');
$object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); $object->prefix_comm = GETPOST('prefix_comm', 'alpha');
$object->code_client = GETPOST('code_client', 'san_alpha'); $object->code_client = GETPOST('code_client', 'alpha');
$object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
$object->capital = GETPOST('capital', 'san_alpha'); $object->capital = GETPOST('capital', 'alpha');
$object->barcode = GETPOST('barcode', 'san_alpha'); $object->barcode = GETPOST('barcode', 'alpha');
$object->tva_intra = GETPOST('tva_intra', 'san_alpha'); $object->tva_intra = GETPOST('tva_intra', 'alpha');
$object->tva_assuj = GETPOST('assujtva_value', 'san_alpha'); $object->tva_assuj = GETPOST('assujtva_value', 'alpha');
$object->status = GETPOST('status', 'san_alpha'); $object->status = GETPOST('status', 'alpha');
// Local Taxes // Local Taxes
$object->localtax1_assuj = GETPOST('localtax1assuj_value', 'san_alpha'); $object->localtax1_assuj = GETPOST('localtax1assuj_value', 'alpha');
$object->localtax2_assuj = GETPOST('localtax2assuj_value', 'san_alpha'); $object->localtax2_assuj = GETPOST('localtax2assuj_value', 'alpha');
$object->localtax1_value = GETPOST('lt1', 'san_alpha'); $object->localtax1_value = GETPOST('lt1', 'alpha');
$object->localtax2_value = GETPOST('lt2', 'san_alpha'); $object->localtax2_value = GETPOST('lt2', 'alpha');
$object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int');
$object->effectif_id = GETPOST('effectif_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int');
@ -446,7 +446,6 @@ if (empty($reshook))
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent"; $sql = "UPDATE ".MAIN_DB_PREFIX."adherent";
$sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id; $sql.= " SET fk_soc = NULL WHERE fk_soc = " . $id;
dol_syslog(get_class($object)."::delete", LOG_DEBUG);
if (! $object->db->query($sql)) if (! $object->db->query($sql))
{ {
$error++; $error++;
@ -528,7 +527,7 @@ if (empty($reshook))
// Define output language // Define output language
$outputlangs = $langs; $outputlangs = $langs;
$newlang=''; $newlang='';
if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id']; if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id')) $newlang=GETPOST('lang_id');
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang; if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$fac->client->default_lang;
if (! empty($newlang)) if (! empty($newlang))
{ {
@ -638,31 +637,31 @@ else
if (GETPOST("type")=='p') { $object->client=2; } if (GETPOST("type")=='p') { $object->client=2; }
if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } if (! empty($conf->fournisseur->enabled) && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; }
$object->name = GETPOST('nom', 'san_alpha'); $object->name = GETPOST('nom', 'alpha');
$object->firstname = GETPOST('firstname', 'san_alpha'); $object->firstname = GETPOST('firstname', 'alpha');
$object->particulier = $private; $object->particulier = $private;
$object->prefix_comm = GETPOST('prefix_comm'); $object->prefix_comm = GETPOST('prefix_comm');
$object->client = GETPOST('client')?GETPOST('client'):$object->client; $object->client = GETPOST('client')?GETPOST('client'):$object->client;
$object->code_client = GETPOST('code_client', 'san_alpha'); $object->code_client = GETPOST('code_client', 'alpha');
$object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur; $object->fournisseur = GETPOST('fournisseur')?GETPOST('fournisseur'):$object->fournisseur;
$object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
$object->address = GETPOST('address', 'san_alpha'); $object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'san_alpha'); $object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'san_alpha'); $object->town = GETPOST('town', 'alpha');
$object->state_id = GETPOST('state_id', 'int'); $object->state_id = GETPOST('state_id', 'int');
$object->skype = GETPOST('skype', 'san_alpha'); $object->skype = GETPOST('skype', 'alpha');
$object->phone = GETPOST('phone', 'san_alpha'); $object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'san_alpha'); $object->fax = GETPOST('fax', 'alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
$object->capital = GETPOST('capital', 'int'); $object->capital = GETPOST('capital', 'int');
$object->barcode = GETPOST('barcode', 'san_alpha'); $object->barcode = GETPOST('barcode', 'alpha');
$object->idprof1 = GETPOST('idprof1', 'san_alpha'); $object->idprof1 = GETPOST('idprof1', 'alpha');
$object->idprof2 = GETPOST('idprof2', 'san_alpha'); $object->idprof2 = GETPOST('idprof2', 'alpha');
$object->idprof3 = GETPOST('idprof3', 'san_alpha'); $object->idprof3 = GETPOST('idprof3', 'alpha');
$object->idprof4 = GETPOST('idprof4', 'san_alpha'); $object->idprof4 = GETPOST('idprof4', 'alpha');
$object->idprof5 = GETPOST('idprof5', 'san_alpha'); $object->idprof5 = GETPOST('idprof5', 'alpha');
$object->idprof6 = GETPOST('idprof6', 'san_alpha'); $object->idprof6 = GETPOST('idprof6', 'alpha');
$object->typent_id = GETPOST('typent_id', 'int'); $object->typent_id = GETPOST('typent_id', 'int');
$object->effectif_id = GETPOST('effectif_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int');
$object->civility_id = GETPOST('civility_id', 'int'); $object->civility_id = GETPOST('civility_id', 'int');
@ -677,7 +676,7 @@ else
$object->localtax1_value =GETPOST('lt1', 'int'); $object->localtax1_value =GETPOST('lt1', 'int');
$object->localtax2_value =GETPOST('lt2', 'int'); $object->localtax2_value =GETPOST('lt2', 'int');
$object->tva_intra = GETPOST('tva_intra', 'san_alpha'); $object->tva_intra = GETPOST('tva_intra', 'alpha');
$object->commercial_id = GETPOST('commercial_id', 'int'); $object->commercial_id = GETPOST('commercial_id', 'int');
$object->default_lang = GETPOST('default_lang'); $object->default_lang = GETPOST('default_lang');
@ -1147,37 +1146,37 @@ else
if (GETPOST('nom')) if (GETPOST('nom'))
{ {
// We overwrite with values if posted // We overwrite with values if posted
$object->name = GETPOST('nom', 'san_alpha'); $object->name = GETPOST('nom', 'alpha');
$object->prefix_comm = GETPOST('prefix_comm', 'san_alpha'); $object->prefix_comm = GETPOST('prefix_comm', 'alpha');
$object->client = GETPOST('client', 'int'); $object->client = GETPOST('client', 'int');
$object->code_client = GETPOST('code_client', 'san_alpha'); $object->code_client = GETPOST('code_client', 'alpha');
$object->fournisseur = GETPOST('fournisseur', 'int'); $object->fournisseur = GETPOST('fournisseur', 'int');
$object->code_fournisseur = GETPOST('code_fournisseur', 'san_alpha'); $object->code_fournisseur = GETPOST('code_fournisseur', 'alpha');
$object->address = GETPOST('address', 'san_alpha'); $object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'san_alpha'); $object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'san_alpha'); $object->town = GETPOST('town', 'alpha');
$object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id; $object->country_id = GETPOST('country_id')?GETPOST('country_id', 'int'):$mysoc->country_id;
$object->state_id = GETPOST('state_id', 'int'); $object->state_id = GETPOST('state_id', 'int');
$object->skype = GETPOST('skype', 'san_alpha'); $object->skype = GETPOST('skype', 'alpha');
$object->phone = GETPOST('phone', 'san_alpha'); $object->phone = GETPOST('phone', 'alpha');
$object->fax = GETPOST('fax', 'san_alpha'); $object->fax = GETPOST('fax', 'alpha');
$object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL); $object->email = GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL);
$object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL); $object->url = GETPOST('url', 'custom', 0, FILTER_SANITIZE_URL);
$object->capital = GETPOST('capital', 'int'); $object->capital = GETPOST('capital', 'int');
$object->idprof1 = GETPOST('idprof1', 'san_alpha'); $object->idprof1 = GETPOST('idprof1', 'alpha');
$object->idprof2 = GETPOST('idprof2', 'san_alpha'); $object->idprof2 = GETPOST('idprof2', 'alpha');
$object->idprof3 = GETPOST('idprof3', 'san_alpha'); $object->idprof3 = GETPOST('idprof3', 'alpha');
$object->idprof4 = GETPOST('idprof4', 'san_alpha'); $object->idprof4 = GETPOST('idprof4', 'alpha');
$object->idprof5 = GETPOST('idprof5', 'san_alpha'); $object->idprof5 = GETPOST('idprof5', 'alpha');
$object->idprof6 = GETPOST('idprof6', 'san_alpha'); $object->idprof6 = GETPOST('idprof6', 'alpha');
$object->typent_id = GETPOST('typent_id', 'int'); $object->typent_id = GETPOST('typent_id', 'int');
$object->effectif_id = GETPOST('effectif_id', 'int'); $object->effectif_id = GETPOST('effectif_id', 'int');
$object->barcode = GETPOST('barcode', 'san_alpha'); $object->barcode = GETPOST('barcode', 'alpha');
$object->forme_juridique_code = GETPOST('forme_juridique_code', 'int'); $object->forme_juridique_code = GETPOST('forme_juridique_code', 'int');
$object->default_lang = GETPOST('default_lang', 'san_alpha'); $object->default_lang = GETPOST('default_lang', 'alpha');
$object->tva_assuj = GETPOST('assujtva_value', 'int'); $object->tva_assuj = GETPOST('assujtva_value', 'int');
$object->tva_intra = GETPOST('tva_intra', 'san_alpha'); $object->tva_intra = GETPOST('tva_intra', 'alpha');
$object->status = GETPOST('status', 'int'); $object->status = GETPOST('status', 'int');
//Local Taxes //Local Taxes

View File

@ -34,7 +34,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$langs->load("orders"); $langs->load("orders");
$langs->load("companies"); $langs->load("companies");
$id=GETPOST('id','int'); $id=GETPOST('id','int')?GETPOST('id','int'):GETPOST('socid','int');
$ref=GETPOST('ref','alpha'); $ref=GETPOST('ref','alpha');
$action=GETPOST('action','alpha'); $action=GETPOST('action','alpha');
@ -44,8 +44,9 @@ $result = restrictedArea($user, 'societe', $id,'');
$object = new Societe($db); $object = new Societe($db);
/* /*
* Ajout d'un nouveau contact * Actions
*/ */
if ($action == 'addcontact' && $user->rights->societe->creer) if ($action == 'addcontact' && $user->rights->societe->creer)
@ -133,12 +134,9 @@ $userstatic=new User($db);
/* Mode vue et edition */ /* Mode vue et edition */
/* */ /* */
/* *************************************************************************** */ /* *************************************************************************** */
dol_htmloutput_mesg($mesg);
if ($id > 0 || ! empty($ref)) if ($id > 0 || ! empty($ref))
{ {
$langs->trans("OrderCard");
if ($object->fetch($id, $ref) > 0) if ($object->fetch($id, $ref) > 0)
{ {
$soc = new Societe($db); $soc = new Societe($db);
@ -154,12 +152,12 @@ if ($id > 0 || ! empty($ref))
print '<td colspan="3">'; print '<td colspan="3">';
print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom'); print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>'; print '</td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{ {
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>'; print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';
} }
if ($object->client) if ($object->client)
{ {
print '<tr><td>'; print '<tr><td>';
@ -168,7 +166,7 @@ if ($id > 0 || ! empty($ref))
if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>'; if ($object->check_codeclient() <> 0) print ' <font class="error">('.$langs->trans("WrongCustomerCode").')</font>';
print '</td></tr>'; print '</td></tr>';
} }
if ($object->fournisseur) if ($object->fournisseur)
{ {
print '<tr><td>'; print '<tr><td>';
@ -216,7 +214,7 @@ if ($id > 0 || ! empty($ref))
{ {
$titre=$langs->trans("MembersListOfTiers"); $titre=$langs->trans("MembersListOfTiers");
print '<br>'; print '<br>';
print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,''); print_barre_liste($titre,$page,$_SERVER["PHP_SELF"],$param,$sortfield,$sortorder,'',$num,$nbtotalofrecords,'');
print "<table class=\"noborder\" width=\"100%\">"; print "<table class=\"noborder\" width=\"100%\">";
@ -230,13 +228,13 @@ if ($id > 0 || ! empty($ref))
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"d.statut,d.datefin",$param,"","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("EndSubscription"),$_SERVER["PHP_SELF"],"d.datefin",$param,"",'align="center"',$sortfield,$sortorder);
print "</tr>\n"; print "</tr>\n";
$var=True; $var=True;
$i=0; $i=0;
while ($i < $num && $i < $conf->liste_limit) while ($i < $num && $i < $conf->liste_limit)
{ {
$objp = $db->fetch_object($resql); $objp = $db->fetch_object($resql);
$datefin=$db->jdate($objp->datefin); $datefin=$db->jdate($objp->datefin);
$memberstatic->id=$objp->rowid; $memberstatic->id=$objp->rowid;
$memberstatic->ref=$objp->rowid; $memberstatic->ref=$objp->rowid;
@ -244,43 +242,43 @@ if ($id > 0 || ! empty($ref))
$memberstatic->firstname=$objp->firstname; $memberstatic->firstname=$objp->firstname;
$companyname=$objp->company; $companyname=$objp->company;
$var=!$var; $var=!$var;
print "<tr ".$bc[$var].">"; print "<tr ".$bc[$var].">";
// Ref // Ref
print "<td>"; print "<td>";
print $memberstatic->getNomUrl(1); print $memberstatic->getNomUrl(1);
print "</td>\n"; print "</td>\n";
// Lastname // Lastname
print "<td><a href=\"card.php?rowid=$objp->rowid\">"; print "<td><a href=\"card.php?rowid=$objp->rowid\">";
print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : ''); print ((! empty($objp->lastname) || ! empty($objp->firstname)) ? dol_trunc($memberstatic->getFullName($langs)) : '');
print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : ''); print (((! empty($objp->lastname) || ! empty($objp->firstname)) && ! empty($companyname)) ? ' / ' : '');
print (! empty($companyname) ? dol_trunc($companyname, 32) : ''); print (! empty($companyname) ? dol_trunc($companyname, 32) : '');
print "</a></td>\n"; print "</a></td>\n";
// Login // Login
print "<td>".$objp->login."</td>\n"; print "<td>".$objp->login."</td>\n";
// Type // Type
$membertypestatic->id=$objp->type_id; $membertypestatic->id=$objp->type_id;
$membertypestatic->libelle=$objp->type; $membertypestatic->libelle=$objp->type;
print '<td class="nowrap">'; print '<td class="nowrap">';
print $membertypestatic->getNomUrl(1,32); print $membertypestatic->getNomUrl(1,32);
print '</td>'; print '</td>';
// Moral/Physique // Moral/Physique
print "<td>".$memberstatic->getmorphylib($objp->morphy)."</td>\n"; print "<td>".$memberstatic->getmorphylib($objp->morphy)."</td>\n";
// EMail // EMail
print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n"; print "<td>".dol_print_email($objp->email,0,0,1)."</td>\n";
// Statut // Statut
print '<td class="nowrap">'; print '<td class="nowrap">';
print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2); print $memberstatic->LibStatut($objp->statut,$objp->cotisation,$datefin,2);
print "</td>"; print "</td>";
// End of subscription date // End of subscription date
if ($datefin) if ($datefin)
{ {
@ -303,7 +301,7 @@ if ($id > 0 || ! empty($ref))
} }
print '</td>'; print '</td>';
} }
print "</tr>\n"; print "</tr>\n";
$i++; $i++;
} }

View File

@ -1325,7 +1325,8 @@ div.tabs {
/* margin: 0px 0px 2px 6px; /* margin: 0px 0px 2px 6px;
padding: 0px 6px 3px 0px; */ padding: 0px 6px 3px 0px; */
text-align: <?php print $left; ?>; text-align: <?php print $left; ?>;
margin-left: 4px !important; margin-left: 6px !important;
margin-right: 6px !important;
clear:both; clear:both;
height:100%; height:100%;
} }
@ -1655,7 +1656,7 @@ table.border, table.dataTable, .table-border, .table-border-col, .table-key-bord
} }
table.border td, div.border div div.tagtd { table.border td, div.border div div.tagtd {
padding: 1px 2px 1px 2px; padding: 2px 2px 2px 2px;
border: 1px solid #D0D0D0; border: 1px solid #D0D0D0;
border-collapse: collapse; border-collapse: collapse;
} }

View File

@ -46,7 +46,7 @@ $actionsave=GETPOST('save','alpha');
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5; if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB; $MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
// List of aviable colors // List of available colors
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5'); $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
// Security check // Security check

View File

@ -36,6 +36,7 @@ require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
if (! empty($conf->agenda->enabled))require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php'; if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php'; if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php'); if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php');
@ -154,7 +155,7 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser)
} }
} }
// Action ajout user // Action Add user
if ($action == 'add' && $canadduser) if ($action == 'add' && $canadduser)
{ {
$error = 0; $error = 0;
@ -205,6 +206,8 @@ if ($action == 'add' && $canadduser)
$object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; $object->salary = GETPOST("salary")!=''?GETPOST("salary"):'';
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
$object->color = GETPOST("color")!=''?GETPOST("color"):'';
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -258,7 +261,7 @@ if ($action == 'add' && $canadduser)
} }
} }
// Action ajout groupe utilisateur // Action add usergroup
if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield) if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield)
{ {
if ($group) if ($group)
@ -350,6 +353,8 @@ if ($action == 'update' && ! $_POST["cancel"])
$object->salary = GETPOST("salary")!=''?GETPOST("salary"):''; $object->salary = GETPOST("salary")!=''?GETPOST("salary"):'';
$object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):''; $object->salaryextra = GETPOST("salaryextra")!=''?GETPOST("salaryextra"):'';
$object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):''; $object->weeklyhours = GETPOST("weeklyhours")!=''?GETPOST("weeklyhours"):'';
$object->color = GETPOST("color")!=''?GETPOST("color"):'';
// Fill array 'array_options' with data from add form // Fill array 'array_options' with data from add form
$ret = $extrafields->setOptionalsFromPost($extralabels,$object); $ret = $extrafields->setOptionalsFromPost($extralabels,$object);
@ -589,6 +594,7 @@ if ($action == 'adduserldap')
*/ */
$form = new Form($db); $form = new Form($db);
$formother=new FormOther($db);
llxHeader('',$langs->trans("UserCard")); llxHeader('',$langs->trans("UserCard"));
@ -670,7 +676,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
setEventMessage($ldap->error, 'errors'); setEventMessage($ldap->error, 'errors');
} }
// Si la liste des users est rempli, on affiche la liste deroulante // If user list is full, we show drop-down list
print "\n\n<!-- Form liste LDAP debut -->\n"; print "\n\n<!-- Form liste LDAP debut -->\n";
print '<form name="add_user_ldap" action="'.$_SERVER["PHP_SELF"].'" method="post">'; print '<form name="add_user_ldap" action="'.$_SERVER["PHP_SELF"].'" method="post">';
@ -767,7 +773,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
} }
$password=$generated_password; $password=$generated_password;
// Mot de passe // Password
print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Password").'</td>'; print '<tr><td valign="top" class="fieldrequired">'.$langs->trans("Password").'</td>';
print '<td>'; print '<td>';
if (! empty($ldap_sid)) if (! empty($ldap_sid))
@ -789,7 +795,7 @@ if (($action == 'create') || ($action == 'adduserldap'))
} }
print '</td></tr>'; print '</td></tr>';
// Administrateur // Administrator
if (! empty($user->admin)) if (! empty($user->admin))
{ {
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td>'; print '<tr><td valign="top">'.$langs->trans("Administrator").'</td>';
@ -974,6 +980,15 @@ if (($action == 'create') || ($action == 'adduserldap'))
print '<input size="8" type="text" name="weeklyhours" value="'.GETPOST('weeklyhours').'">'; print '<input size="8" type="text" name="weeklyhours" value="'.GETPOST('weeklyhours').'">';
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// User color
if (! empty($conf->agenda->enabled))
{
print '<tr><td valign="top">'.$langs->trans("ColorUser").'</td>';
print '<td>';
print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset');
print '</td></tr>';
}
// Note // Note
print '<tr><td valign="top">'; print '<tr><td valign="top">';
@ -1002,7 +1017,7 @@ else
{ {
/* ************************************************************************** */ /* ************************************************************************** */
/* */ /* */
/* Visu et edition */ /* View and edition */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -1032,7 +1047,7 @@ else
$userDisabled = 0; $userDisabled = 0;
$statutUACF = ''; $statutUACF = '';
//On verifie les options du compte // Check options of user account
if (count($ldap->uacf) > 0) if (count($ldap->uacf) > 0)
{ {
foreach ($ldap->uacf as $key => $statut) foreach ($ldap->uacf as $key => $statut)
@ -1080,7 +1095,7 @@ else
} }
/* /*
* Confirmation desactivation * Confirm deactivation
*/ */
if ($action == 'disable') if ($action == 'disable')
{ {
@ -1088,7 +1103,7 @@ else
} }
/* /*
* Confirmation activation * Confirm activation
*/ */
if ($action == 'enable') if ($action == 'enable')
{ {
@ -1108,13 +1123,13 @@ else
*/ */
if ($action != 'edit') if ($action != 'edit')
{ {
$rowspan=16; $rowspan=17;
print '<table class="border" width="100%">'; print '<table class="border" width="100%">';
// Ref // Ref
print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>'; print '<tr><td width="25%" valign="top">'.$langs->trans("Ref").'</td>';
print '<td colspan="2">'; print '<td colspan="3">';
print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin);
print '</td>'; print '</td>';
print '</tr>'."\n"; print '</tr>'."\n";
@ -1123,10 +1138,12 @@ else
if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++;
if (! empty($conf->adherent->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++;
if (! empty($conf->skype->enabled)) $rowspan++; if (! empty($conf->skype->enabled)) $rowspan++;
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3;
if (! empty($conf->agenda->enabled)) $rowspan++;
// Lastname // Lastname
print '<tr><td valign="top">'.$langs->trans("Lastname").'</td>'; print '<tr><td valign="top">'.$langs->trans("Lastname").'</td>';
print '<td>'.$object->lastname.'</td>'; print '<td colspan="2">'.$object->lastname.'</td>';
// Photo // Photo
print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">'; print '<td align="center" valign="middle" width="25%" rowspan="'.$rowspan.'">';
@ -1137,23 +1154,23 @@ else
// Firstname // Firstname
print '<tr><td valign="top">'.$langs->trans("Firstname").'</td>'; print '<tr><td valign="top">'.$langs->trans("Firstname").'</td>';
print '<td>'.$object->firstname.'</td>'; print '<td colspan="2">'.$object->firstname.'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Position/Job // Position/Job
print '<tr><td valign="top">'.$langs->trans("PostOrFunction").'</td>'; print '<tr><td valign="top">'.$langs->trans("PostOrFunction").'</td>';
print '<td>'.$object->job.'</td>'; print '<td colspan="2">'.$object->job.'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Login // Login
print '<tr><td valign="top">'.$langs->trans("Login").'</td>'; print '<tr><td valign="top">'.$langs->trans("Login").'</td>';
if (! empty($object->ldap_sid) && $object->statut==0) if (! empty($object->ldap_sid) && $object->statut==0)
{ {
print '<td class="error">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>'; print '<td colspan="2" class="error">'.$langs->trans("LoginAccountDisableInDolibarr").'</td>';
} }
else else
{ {
print '<td>'.$object->login.'</td>'; print '<td colspan="2">'.$object->login.'</td>';
} }
print '</tr>'."\n"; print '</tr>'."\n";
@ -1163,24 +1180,24 @@ else
{ {
if ($passDoNotExpire) if ($passDoNotExpire)
{ {
print '<td>'.$langs->trans("LdapUacf_".$statutUACF).'</td>'; print '<td colspan="2">'.$langs->trans("LdapUacf_".$statutUACF).'</td>';
} }
else if($userChangePassNextLogon) else if($userChangePassNextLogon)
{ {
print '<td class="warning">'.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).'</td>'; print '<td colspan="2" class="warning">'.$langs->trans("UserMustChangePassNextLogon",$ldap->domainFQDN).'</td>';
} }
else if($userDisabled) else if($userDisabled)
{ {
print '<td class="warning">'.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).'</td>'; print '<td colspan="2" class="warning">'.$langs->trans("LdapUacf_".$statutUACF,$ldap->domainFQDN).'</td>';
} }
else else
{ {
print '<td>'.$langs->trans("DomainPassword").'</td>'; print '<td colspan="2">'.$langs->trans("DomainPassword").'</td>';
} }
} }
else else
{ {
print '<td>'; print '<td colspan="2">';
if ($object->pass) print preg_replace('/./i','*',$object->pass); if ($object->pass) print preg_replace('/./i','*',$object->pass);
else else
{ {
@ -1192,7 +1209,7 @@ else
print '</tr>'."\n"; print '</tr>'."\n";
// Administrator // Administrator
print '<tr><td valign="top">'.$langs->trans("Administrator").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("Administrator").'</td><td colspan="2">';
if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity) if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity)
{ {
print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin");
@ -1208,7 +1225,7 @@ else
print '</td></tr>'."\n"; print '</td></tr>'."\n";
// Type // Type
print '<tr><td valign="top">'.$langs->trans("Type").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("Type").'</td><td colspan="2">';
$type=$langs->trans("Internal"); $type=$langs->trans("Internal");
if ($object->societe_id) $type=$langs->trans("External"); if ($object->societe_id) $type=$langs->trans("External");
print $form->textwithpicto($type,$langs->trans("InternalExternalDesc")); print $form->textwithpicto($type,$langs->trans("InternalExternalDesc"));
@ -1218,47 +1235,47 @@ else
// Ldap sid // Ldap sid
if ($object->ldap_sid) if ($object->ldap_sid)
{ {
print '<tr><td valign="top">'.$langs->trans("Type").'</td><td>'; print '<tr><td valign="top">'.$langs->trans("Type").'</td><td colspan="2">';
print $langs->trans("DomainUser",$ldap->domainFQDN); print $langs->trans("DomainUser",$ldap->domainFQDN);
print '</td></tr>'."\n"; print '</td></tr>'."\n";
} }
// Tel pro // Tel pro
print '<tr><td valign="top">'.$langs->trans("PhonePro").'</td>'; print '<tr><td valign="top">'.$langs->trans("PhonePro").'</td>';
print '<td>'.dol_print_phone($object->office_phone,'',0,0,1).'</td>'; print '<td colspan="2">'.dol_print_phone($object->office_phone,'',0,0,1).'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Tel mobile // Tel mobile
print '<tr><td valign="top">'.$langs->trans("PhoneMobile").'</td>'; print '<tr><td valign="top">'.$langs->trans("PhoneMobile").'</td>';
print '<td>'.dol_print_phone($object->user_mobile,'',0,0,1).'</td>'; print '<td colspan="2">'.dol_print_phone($object->user_mobile,'',0,0,1).'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Fax // Fax
print '<tr><td valign="top">'.$langs->trans("Fax").'</td>'; print '<tr><td valign="top">'.$langs->trans("Fax").'</td>';
print '<td>'.dol_print_phone($object->office_fax,'',0,0,1).'</td>'; print '<td colspan="2">'.dol_print_phone($object->office_fax,'',0,0,1).'</td>';
print '</tr>'."\n"; print '</tr>'."\n";
// Skype // Skype
if (! empty($conf->skype->enabled)) if (! empty($conf->skype->enabled))
{ {
print '<tr><td valign="top">'.$langs->trans("Skype").'</td>'; print '<tr><td valign="top">'.$langs->trans("Skype").'</td>';
print '<td>'.dol_print_skype($object->skype,0,0,1).'</td>'; print '<td colspan="2">'.dol_print_skype($object->skype,0,0,1).'</td>';
print "</tr>\n"; print "</tr>\n";
} }
// EMail // EMail
print '<tr><td valign="top">'.$langs->trans("EMail").'</td>'; print '<tr><td valign="top">'.$langs->trans("EMail").'</td>';
print '<td>'.dol_print_email($object->email,0,0,1).'</td>'; print '<td colspan="2">'.dol_print_email($object->email,0,0,1).'</td>';
print "</tr>\n"; print "</tr>\n";
// Signature // Signature
print '<tr><td valign="top">'.$langs->trans('Signature').'</td><td>'; print '<tr><td valign="top">'.$langs->trans('Signature').'</td><td colspan="2">';
print dol_htmlentitiesbr($object->signature); print dol_htmlentitiesbr($object->signature);
print "</td></tr>\n"; print "</td></tr>\n";
// Hierarchy // Hierarchy
print '<tr><td valign="top">'.$langs->trans("HierarchicalResponsible").'</td>'; print '<tr><td valign="top">'.$langs->trans("HierarchicalResponsible").'</td>';
print '<td>'; print '<td colspan="2">';
if (empty($object->fk_user)) print $langs->trans("None"); if (empty($object->fk_user)) print $langs->trans("None");
else { else {
$huser=new User($db); $huser=new User($db);
@ -1268,27 +1285,27 @@ else
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
if ($conf->salaries->enabled && ! empty($user->rights->salaries->read)) if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
{ {
$langs->load("salaries"); $langs->load("salaries");
// THM // THM
print '<tr><td valign="top">'.$langs->trans("THM").'</td>'; print '<tr><td valign="top">'.$langs->trans("THM").'</td>';
print '<td>'; print '<td colspan="2">';
print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):''); print ($object->thm!=''?price($object->thm,'',$langs,1,-1,-1,$conf->currency):'');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// TJM // TJM
print '<tr><td valign="top">'.$langs->trans("TJM").'</td>'; print '<tr><td valign="top">'.$langs->trans("TJM").'</td>';
print '<td>'; print '<td colspan="2">';
print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):''); print ($object->tjm!=''?price($object->tjm,'',$langs,1,-1,-1,$conf->currency):'');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
// Salary // Salary
print '<tr><td valign="top">'.$langs->trans("Salary").'</td>'; print '<tr><td valign="top">'.$langs->trans("Salary").'</td>';
print '<td>'; print '<td colspan="2">';
print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):''); print ($object->salary!=''?price($object->salary,'',$langs,1,-1,-1,$conf->currency):'');
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -1296,7 +1313,7 @@ else
// Weeklyhours // Weeklyhours
print '<tr><td valign="top">'.$langs->trans("WeeklyHours").'</td>'; print '<tr><td valign="top">'.$langs->trans("WeeklyHours").'</td>';
print '<td>'; print '<td colspan="2">';
print price2num($object->weeklyhours); print price2num($object->weeklyhours);
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
@ -1306,28 +1323,39 @@ else
{ {
$rowspan++; $rowspan++;
print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>'; print '<tr><td valign="top">'.$langs->trans("AccountancyCode").'</td>';
print '<td>'.$object->accountancy_code.'</td>'; print '<td colspan="2">'.$object->accountancy_code.'</td>';
}
// Color user
if (! empty($conf->agenda->enabled))
{
print '<tr><td valign="top">'.$langs->trans("ColorUser").'</td>';
print '<td width="50px" bgcolor="'.$object->color.'">';
print $object->color;
print '</td>';
print '<td>&nbsp;</td>';
print "</tr>\n";
} }
// Status // Status
print '<tr><td valign="top">'.$langs->trans("Status").'</td>'; print '<tr><td valign="top">'.$langs->trans("Status").'</td>';
print '<td>'; print '<td colspan="2">';
print $object->getLibStatut(4); print $object->getLibStatut(4);
print '</td>'; print '</td>';
print '</tr>'."\n"; print '</tr>'."\n";
print '<tr><td valign="top">'.$langs->trans("LastConnexion").'</td>'; print '<tr><td valign="top">'.$langs->trans("LastConnexion").'</td>';
print '<td>'.dol_print_date($object->datelastlogin,"dayhour").'</td>'; print '<td colspan="2">'.dol_print_date($object->datelastlogin,"dayhour").'</td>';
print "</tr>\n"; print "</tr>\n";
print '<tr><td valign="top">'.$langs->trans("PreviousConnexion").'</td>'; print '<tr><td valign="top">'.$langs->trans("PreviousConnexion").'</td>';
print '<td>'.dol_print_date($object->datepreviouslogin,"dayhour").'</td>'; print '<td colspan="2">'.dol_print_date($object->datepreviouslogin,"dayhour").'</td>';
print "</tr>\n"; print "</tr>\n";
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER))
{ {
print '<tr><td valign="top">'.$langs->trans("OpenIDURL").'</td>'; print '<tr><td valign="top">'.$langs->trans("OpenIDURL").'</td>';
print '<td>'.$object->openid.'</td>'; print '<td colspan="2">'.$object->openid.'</td>';
print "</tr>\n"; print "</tr>\n";
} }
@ -1335,7 +1363,7 @@ else
if (! empty($conf->societe->enabled)) if (! empty($conf->societe->enabled))
{ {
print '<tr><td valign="top">'.$langs->trans("LinkToCompanyContact").'</td>'; print '<tr><td valign="top">'.$langs->trans("LinkToCompanyContact").'</td>';
print '<td>'; print '<td colspan="2">';
if (isset($object->societe_id) && $object->societe_id > 0) if (isset($object->societe_id) && $object->societe_id > 0)
{ {
$societe = new Societe($db); $societe = new Societe($db);
@ -1363,7 +1391,7 @@ else
{ {
$langs->load("members"); $langs->load("members");
print '<tr><td valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>'; print '<tr><td valign="top">'.$langs->trans("LinkedToDolibarrMember").'</td>';
print '<td>'; print '<td colspan="2">';
if ($object->fk_member) if ($object->fk_member)
{ {
$adh=new Adherent($db); $adh=new Adherent($db);
@ -1631,7 +1659,10 @@ else
if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++; if (isset($conf->file->main_authentication) && preg_match('/openid/',$conf->file->main_authentication) && ! empty($conf->global->MAIN_OPENIDURL_PERUSER)) $rowspan++;
if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++;
if (! empty($conf->adherent->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++;
if (! empty($conf->skype->enabled)) $rowspan++;
if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read)) $rowspan = $rowspan+3;
if (! empty($conf->agenda->enabled)) $rowspan++;
print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST" name="updateuser" enctype="multipart/form-data">'; print '<form action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'" method="POST" name="updateuser" enctype="multipart/form-data">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">'; print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="update">'; print '<input type="hidden" name="action" value="update">';
@ -1696,7 +1727,7 @@ else
print '<input size="30" type="text" name="job" value="'.$object->job.'">'; print '<input size="30" type="text" name="job" value="'.$object->job.'">';
} }
else else
{ {
print '<input type="hidden" name="job" value="'.$object->job.'">'; print '<input type="hidden" name="job" value="'.$object->job.'">';
print $object->job; print $object->job;
} }
@ -1918,7 +1949,7 @@ else
print $doleditor->Create(1); print $doleditor->Create(1);
} }
else else
{ {
print dol_htmlentitiesbr($object->signature); print dol_htmlentitiesbr($object->signature);
} }
print '</td></tr>'; print '</td></tr>';
@ -1957,7 +1988,7 @@ else
print '</td>'; print '</td>';
print "</tr>\n"; print "</tr>\n";
if ($conf->salaries->enabled && ! empty($user->rights->salaries->read)) if (! empty($conf->salaries->enabled) && ! empty($user->rights->salaries->read))
{ {
$langs->load("salaries"); $langs->load("salaries");
@ -2008,6 +2039,15 @@ else
print '</td>'; print '</td>';
print "</tr>"; print "</tr>";
} }
// User color
if (! empty($conf->agenda->enabled))
{
print '<tr><td valign="top">'.$langs->trans("ColorUser").'</td>';
print '<td>';
print $formother->selectColor(GETPOST('color')?GETPOST('color'):$object->color, 'color', 'usercolorconfig', 1, '', 'hideifnotset');
print '</td></tr>';
}
// Status // Status
print '<tr><td valign="top">'.$langs->trans("Status").'</td>'; print '<tr><td valign="top">'.$langs->trans("Status").'</td>';

View File

@ -51,7 +51,7 @@ class User extends CommonObject
var $firstname; var $firstname;
var $note; var $note;
var $email; var $email;
var $skype; var $skype;
var $job; var $job;
var $signature; var $signature;
var $office_phone; var $office_phone;
@ -101,13 +101,14 @@ class User extends CommonObject
var $users; // To store all tree of users hierarchy var $users; // To store all tree of users hierarchy
var $parentof; // To store an array of all parents for all ids. var $parentof; // To store an array of all parents for all ids.
var $accountancy_code; // Accountancy code in prevision of the complete accountancy module var $accountancy_code; // Accountancy code in prevision of the complete accountancy module
var $thm; // Average cost of employee var $thm; // Average cost of employee
var $tjm; // Average cost of employee var $tjm; // Average cost of employee
var $salary; // Monthly salary var $salary; // Monthly salary
var $salaryextra; // Monthly salary extra var $salaryextra; // Monthly salary extra
var $weeklyhours; // Weekly hours var $weeklyhours; // Weekly hours
var $color; // Define background color for user in agenda
/** /**
* Constructor de la classe * Constructor de la classe
@ -166,6 +167,7 @@ class User extends CommonObject
$sql.= " u.salary,"; $sql.= " u.salary,";
$sql.= " u.salaryextra,"; $sql.= " u.salaryextra,";
$sql.= " u.weeklyhours,"; $sql.= " u.weeklyhours,";
$sql.= " u.color,";
$sql.= " u.ref_int, u.ref_ext"; $sql.= " u.ref_int, u.ref_ext";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
@ -233,6 +235,7 @@ class User extends CommonObject
$this->salary = $obj->salary; $this->salary = $obj->salary;
$this->salaryextra = $obj->salaryextra; $this->salaryextra = $obj->salaryextra;
$this->weeklyhours = $obj->weeklyhours; $this->weeklyhours = $obj->weeklyhours;
$this->color = $obj->color;
$this->datec = $this->db->jdate($obj->datec); $this->datec = $this->db->jdate($obj->datec);
$this->datem = $this->db->jdate($obj->datem); $this->datem = $this->db->jdate($obj->datem);
@ -270,7 +273,7 @@ class User extends CommonObject
return -1; return -1;
} }
// Recupere parametrage global propre a l'utilisateur // To get back the global configuration unique to the user
if ($loadpersonalconf) if ($loadpersonalconf)
{ {
$sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param"; $sql = "SELECT param, value FROM ".MAIN_DB_PREFIX."user_param";
@ -302,7 +305,7 @@ class User extends CommonObject
} }
/** /**
* Ajoute un droit a l'utilisateur * Add a right to the user
* *
* @param int $rid id du droit a ajouter * @param int $rid id du droit a ajouter
* @param string $allmodule Ajouter tous les droits du module allmodule * @param string $allmodule Ajouter tous les droits du module allmodule
@ -404,7 +407,7 @@ class User extends CommonObject
/** /**
* Retire un droit a l'utilisateur * Remove a right to the user
* *
* @param int $rid Id du droit a retirer * @param int $rid Id du droit a retirer
* @param string $allmodule Retirer tous les droits du module allmodule * @param string $allmodule Retirer tous les droits du module allmodule
@ -672,7 +675,7 @@ class User extends CommonObject
$this->db->begin(); $this->db->begin();
// Desactive utilisateur // Deactivate user
$sql = "UPDATE ".MAIN_DB_PREFIX."user"; $sql = "UPDATE ".MAIN_DB_PREFIX."user";
$sql.= " SET statut = ".$this->statut; $sql.= " SET statut = ".$this->statut;
$sql.= " WHERE rowid = ".$this->id; $sql.= " WHERE rowid = ".$this->id;
@ -717,7 +720,7 @@ class User extends CommonObject
dol_syslog(get_class($this)."::delete", LOG_DEBUG); dol_syslog(get_class($this)."::delete", LOG_DEBUG);
// Supprime droits // Remove rights
$sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id; $sql = "DELETE FROM ".MAIN_DB_PREFIX."user_rights WHERE fk_user = ".$this->id;
if (! $error && ! $this->db->query($sql)) if (! $error && ! $this->db->query($sql))
@ -734,7 +737,7 @@ class User extends CommonObject
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
} }
// Si contact, supprime lien // If contact, remove link
if ($this->contact_id) if ($this->contact_id)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id; $sql = "UPDATE ".MAIN_DB_PREFIX."socpeople SET fk_user_creat = null WHERE rowid = ".$this->contact_id;
@ -1063,7 +1066,7 @@ class User extends CommonObject
} }
/** /**
* Affectation des permissions par defaut * Assign rights by default
* *
* @return Si erreur <0, si ok renvoi le nbre de droits par defaut positionnes * @return Si erreur <0, si ok renvoi le nbre de droits par defaut positionnes
*/ */
@ -1142,6 +1145,7 @@ class User extends CommonObject
$this->zip = empty($this->zip)?'':$this->zip; $this->zip = empty($this->zip)?'':$this->zip;
$this->town = empty($this->town)?'':$this->town; $this->town = empty($this->town)?'':$this->town;
$this->accountancy_code = trim($this->accountancy_code); $this->accountancy_code = trim($this->accountancy_code);
$this->color = empty($this->color)?'':$this->color;
// Check parameters // Check parameters
if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email)) if (! empty($conf->global->USER_MAIL_REQUIRED) && ! isValidEMail($this->email))
@ -1150,7 +1154,7 @@ class User extends CommonObject
$this->error = $langs->trans("ErrorBadEMail",$this->email); $this->error = $langs->trans("ErrorBadEMail",$this->email);
return -1; return -1;
} }
$this->db->begin(); $this->db->begin();
// Mise a jour autres infos // Mise a jour autres infos
@ -1172,6 +1176,7 @@ class User extends CommonObject
$sql.= ", job = '".$this->db->escape($this->job)."'"; $sql.= ", job = '".$this->db->escape($this->job)."'";
$sql.= ", signature = '".$this->db->escape($this->signature)."'"; $sql.= ", signature = '".$this->db->escape($this->signature)."'";
$sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'"; $sql.= ", accountancy_code = '".$this->db->escape($this->accountancy_code)."'";
$sql.= ", color = '".$this->db->escape($this->color)."'";
$sql.= ", note = '".$this->db->escape($this->note)."'"; $sql.= ", note = '".$this->db->escape($this->note)."'";
$sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null"); $sql.= ", photo = ".($this->photo?"'".$this->db->escape($this->photo)."'":"null");
$sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null"); $sql.= ", openid = ".($this->openid?"'".$this->db->escape($this->openid)."'":"null");

View File

@ -664,6 +664,8 @@ function createOrder($authentication,$order)
$newline->total_ht=$line['total_net']; $newline->total_ht=$line['total_net'];
$newline->total_tva=$line['total_vat']; $newline->total_tva=$line['total_vat'];
$newline->total_ttc=$line['total']; $newline->total_ttc=$line['total'];
$newline->date_start=$line['date_start'];
$newline->date_end=$line['date_end'];
$newobject->lines[]=$newline; $newobject->lines[]=$newline;
} }

0
scripts/accountancy/export-thirdpartyaccount.php Normal file → Executable file
View File