diff --git a/ChangeLog b/ChangeLog index 803703caf9d..8fd47651f99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -62,7 +62,14 @@ For users: - New: Can choose menu entry to show with external site module. - New: Add hidden option MAIN_PDF_MARGIN_LEFT, MAIN_PDF_MARGIN_RIGHT, MAIN_PDF_MARGIN_TOP, MAIN_PDF_MARGIN_BOTTOM to force margins of generated PDF. -- New: [ task #314 ] Can define if prof id are mandatory or not +- New: [ task #314 ] Can define if prof id are mandatory or not. +- New: Add button on order card to create intervention from services. +- New: Add search box to find products by supplier reference. +- New: Add option MAIN_HELPCENTER_LINKTOUSE to define target link "I need help" onto logon page. +- New: [ task #608 ] Can clone a supplier order with prices updates +- New: [ task #559 ] Can define a discount % regarding quantity in supplier prices and price by quantity in customer prices +- New: [ task #527 ] After cloning a suplier invoice, go onto invoice ref into edit mode + New experimental modules: - New: Add margin management module. - New: Add commissions management module. diff --git a/htdocs/admin/agenda_extrafields.php b/htdocs/admin/agenda_extrafields.php new file mode 100644 index 00000000000..4e1518d97aa --- /dev/null +++ b/htdocs/admin/agenda_extrafields.php @@ -0,0 +1,161 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * Copyright (C) 2012 Florian Henry + * + * 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 2 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 . + */ + +/** + * \file htdocs/admin/agenda_extrafields.php + * \ingroup agenda + * \brief Page to setup extra fields of agenda + */ + +require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + + +if (!$user->admin) + accessforbidden(); + +$langs->load("admin"); +$langs->load("other"); + +$extrafields = new ExtraFields($db); +$form = new Form($db); + +// List of supported format +$tmptype2label=getStaticMember(get_class($extrafields),'type2label'); +$type2label=array(''); +foreach ($tmptype2label as $key => $val) $type2label[$key]=$langs->trans($val); + +$action=GETPOST('action', 'alpha'); +$attrname=GETPOST('attrname', 'alpha'); +$elementtype='actioncomm'; + +if (!$user->admin) accessforbidden(); + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; + + + +/* + * View + */ + + +llxHeader(); + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("AgendaSetup"),$linkback,'setup'); +print "
\n"; + +print "
\n"; + +$head=agenda_prepare_head(); + +dol_fiche_head($head, 'attributes', $langs->trans("Agenda")); + + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print '
'; + +dol_htmloutput_errors($mesg); + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print ""; + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; +print "\n"; + +$var=True; +foreach($extrafields->attribute_type as $key => $value) +{ + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + print '\n"; + print '\n"; + print '\n"; + print '\n"; + print ""; + // $i++; +} + +print "
'.$langs->trans("Label").''.$langs->trans("AttributeCode").''.$langs->trans("Type").''.$langs->trans("Size").''.$langs->trans("Unique").''.$langs->trans("Required").' 
".$extrafields->attribute_label[$key]."".$key."".$type2label[$extrafields->attribute_type[$key]]."'.$extrafields->attribute_size[$key]."'.yn($extrafields->attribute_unique[$key])."'.yn($extrafields->attribute_required[$key])."'.img_edit().''; + print "  ".img_delete()."
"; + +dol_fiche_end(); + + +// Buttons +if ($action != 'create' && $action != 'edit') +{ + print '
'; + print "".$langs->trans("NewAttribute").""; + print "
"; +} + + +/* ************************************************************************** */ +/* */ +/* Creation d'un champ optionnel + /* */ +/* ************************************************************************** */ + +if ($action == 'create') +{ + print "
"; + print_titre($langs->trans('NewAttribute')); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_add.tpl.php'; +} + +/* ************************************************************************** */ +/* */ +/* Edition d'un champ optionnel */ +/* */ +/* ************************************************************************** */ +if ($action == 'edit' && ! empty($attrname)) +{ + print "
"; + print_titre($langs->trans("FieldEdition", $attrname)); + + require DOL_DOCUMENT_ROOT.'/core/tpl/admin_extrafields_edit.tpl.php'; +} + +llxFooter(); + +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index a79650fa893..489c9d2409d 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -209,6 +209,25 @@ class ActionComm extends CommonObject { $this->id = $this->db->last_insert_id(MAIN_DB_PREFIX."actioncomm","id"); + // Actions on extra fields (by external module or standard code) + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + $hookmanager->initHooks(array('actioncommdao')); + $parameters=array('actcomm'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; + if (! $notrigger) { // Appel des triggers @@ -343,7 +362,19 @@ class ActionComm extends CommonObject $sql.= " WHERE id=".$this->id; dol_syslog(get_class($this)."::delete sql=".$sql, LOG_DEBUG); - if ($this->db->query($sql)) + $res=$this->db->query($sql); + if ($res < 0) { + $this->error=$this->db->lasterror(); + $error++; + } + + // Removed extrafields + if (! $error) { + $result=$this->deleteExtraFields($this); + if ($result < 0) $error++; + } + + if (!$error) { if (! $notrigger) { @@ -437,6 +468,26 @@ class ActionComm extends CommonObject dol_syslog(get_class($this)."::update sql=".$sql); if ($this->db->query($sql)) { + + // Actions on extra fields (by external module or standard code) + include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; + $hookmanager=new HookManager($this->db); + $hookmanager->initHooks(array('actioncommdao')); + $parameters=array('actcomm'=>$this->id); + $reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks + if (empty($reshook)) + { + if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used + { + $result=$this->insertExtraFields(); + if ($result < 0) + { + $error++; + } + } + } + else if ($reshook < 0) $error++; + if (! $notrigger) { // Appel des triggers diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 5b5ebee90ee..a574664f677 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -35,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php'; require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("companies"); $langs->load("commercial"); @@ -60,6 +61,8 @@ $mesg=''; $cactioncomm = new CActionComm($db); $actioncomm = new ActionComm($db); $contact = new Contact($db); +$extrafields = new ExtraFields($db); + //var_dump($_POST); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array @@ -202,6 +205,15 @@ if ($action == 'add_action') $mesg='
'.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Date")).'
'; } + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $actioncomm->array_options[$key]=GETPOST($key); + } + } + if (! $error) { $db->begin(); @@ -332,6 +344,15 @@ if ($action == 'update') } $actioncomm->userdone = $userdone; + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $actioncomm->array_options[$key]=GETPOST($key); + } + } + if (! $error) { $db->begin(); @@ -375,6 +396,8 @@ llxHeader('',$langs->trans("Agenda"),$help_url); $form = new Form($db); $htmlactions = new FormActions($db); +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('actioncomm'); if ($action == 'create') { @@ -579,11 +602,30 @@ if ($action == 'create') print ''; // Other attributes - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$actioncomm,$action); // Note that $action and $object may have been modified by hook + print ' '; + print ''; + + // Other attributes + $parameters=array(); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$actioncomm,$action); // Note that $action and $object may have been modified by hook print ''; + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print '

'; + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($actioncomm->array_options["options_".$key])?$actioncomm->array_options["options_".$key]:'')); + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print ' width="30%">'.$label.''."\n"; + } + print '
'; + print $extrafields->showInputField($key,$value); + print '


'; + } + print '

'; print ''; print '     '; @@ -607,6 +649,8 @@ if ($id) $act = new ActionComm($db); $result=$act->fetch($id); + $act->fetch_optionals($id,$extralabels); + if ($result < 0) { dol_print_error($db,$act->error); @@ -792,8 +836,32 @@ if ($id) $doleditor->Create(); print ''; + // Other attributes + print ' '; + print ''; + + // Other attributes + $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook + print ''; + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print '

'; + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$act->array_options["options_".$key]); + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print ' width="30%">'.$label.''."\n"; + } + print '
'; + print $extrafields->showInputField($key,$value); + print '


'; + } + + print '

'; print '     '; print '
'; @@ -957,11 +1025,28 @@ if ($id) print dol_htmlentitiesbr($act->note); print ''; - // Other attributes - $parameters=array(); - $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook + print ' '; + print ''; + + // Other attributes + $parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook print ''; + + //Extra field + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + print '

'; + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:(isset($act->array_options['options_'.$key])?$act->array_options['options_'.$key]:'')); + print '\n"; + } + print '
'.$label.''; + print $extrafields->showOutputField($key,$value); + print "


'; + } } print "\n"; diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 04a4af7e09d..4819172cff5 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -529,7 +529,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie { if ($conf->use_javascript_ajax && !empty($conf->global->MAIN_JS_ON_PAYMENT)) { - print img_picto($langs->trans('AddRemind'),'rightarrow.png','id="'.$objp->facid.'" "'); + print img_picto($langs->trans('AddRemind'),'rightarrow.png','id="'.$objp->facid.'"'); } print ''; print ''; diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index 73450228480..9bfe97a4737 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -130,7 +130,7 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit) $bon = new BonPrelevement($db,""); $form = new Form($db); -llxHeader('',$langs->trans("WithdrawalReceipt")); +llxHeader('',$langs->trans("WithdrawalReceipts")); if ($id > 0) @@ -138,7 +138,7 @@ if ($id > 0) $bon->fetch($id); $head = prelevement_prepare_head($bon); - dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalReceipt"), '', 'payment'); + dol_fiche_head($head, 'prelevement', $langs->trans("WithdrawalReceipts"), '', 'payment'); if (GETPOST('error','alpha')!='') { diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index eb1c4c9e435..75a5086e711 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -2067,6 +2067,36 @@ abstract class CommonObject } } + /** + * Delete all extra fields values for the current object. + * + * @return void + */ + function deleteExtraFields() + { + global $langs; + + $error=0; + + $this->db->begin(); + + $sql_del = "DELETE FROM ".MAIN_DB_PREFIX.$this->table_element."_extrafields WHERE fk_object = ".$this->id; + dol_syslog(get_class($this)."::insertExtraFields delete sql=".$sql_del); + $this->db->query($sql_del); + + if (! $resql) + { + $this->error=$this->db->lasterror(); + dol_syslog(get_class($this)."::delete ".$this->error,LOG_ERR); + $this->db->rollback(); + return -1; + } + else + { + $this->db->commit(); + return 1; + } + } /** * Add/Update all extra fields values for the current object. diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e0c12b2c221..9d71b10a20b 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -379,7 +379,12 @@ class Form $s=""; if (empty($notabs)) $s.=''; if ($direction < 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; - if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; + // Use another method to help avoid having a space in value in order to use this value with jquery + // TODO add this in css + //if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.(($direction < 0)?' ':'').$text.(($direction > 0)?' ':'').''; + $paramfortooltiptd.= (($direction < 0)?' style="padding-left: 3px !important;"':''); + $paramfortooltiptd.= (($direction > 0)?' style="padding-right: 3px !important;"':''); + if ($text != '') $s.='<'.$tag.$paramfortooltiptd.'>'.$text.''; if ($direction > 0) $s.='<'.$tag.$paramfortooltipimg.' valign="top" width="14">'.$img.''; if (empty($notabs)) $s.='
'; @@ -1229,13 +1234,13 @@ class Form $opt = ''; $optJson = array(); $objp = $this->db->fetch_object($result); - + if(!empty($objp->price_by_qty) && $objp->price_by_qty == 1) { // Price by quantity will return many prices for the same product $sql = "SELECT rowid, quantity, price, unitprice, remise_percent, remise"; $sql.= " FROM ".MAIN_DB_PREFIX."product_price_by_qty"; $sql.= " WHERE fk_product_price=".$objp->price_rowid; $sql.= " ORDER BY quantity ASC"; - + dol_syslog(get_class($this)."::select_produits_do search price by qty sql=".$sql); $result2 = $this->db->query($sql); if ($result2) @@ -1244,18 +1249,18 @@ class Form $j = 0; while ($nb_prices && $j < $nb_prices) { $objp2 = $this->db->fetch_object($result2); - + $objp->quantity = $objp2->quantity; $objp->price = $objp2->price; $objp->unitprice = $objp2->unitprice; $objp->remise_percent = $objp2->remise_percent; $objp->remise = $objp2->remise; $objp->price_by_qty_rowid = $objp2->rowid; - + $this->_construct_product_list_option($objp, $opt, $optJson, 0, $selected); - + $j++; - + // Add new entry // "key" value of json key array is used by jQuery automatically as selected value // "label" value of json key array is used by jQuery automatically as text for combo box @@ -1290,7 +1295,7 @@ class Form function _construct_product_list_option(&$objp, &$opt, &$optJson, $price_level, $selected) { global $langs,$conf,$user,$db; - + $outkey=''; $outval=''; $outref=''; @@ -1394,7 +1399,7 @@ class Form $opt.= $langs->trans("Units"); // Do not use strtolower because it breaks utf8 encoding $outval.=$langs->transnoentities("Units"); } - + $outprice_ht=price($objp->unitprice); $outprice_ttc=price($objp->unitprice * (1 + ($objp->tva_tx / 100))); $outpricebasetype=$objp->price_base_type; @@ -2333,7 +2338,7 @@ class Form // Clean parameters $newselectedchoice=empty($selectedchoice)?"no":$selectedchoice; - + if (is_array($formquestion) && ! empty($formquestion)) { $more.=''."\n"; @@ -2494,7 +2499,7 @@ class Form } }); - + var button = "'.$button.'"; if (button.length > 0) { $( "#" + button ).click(function() { diff --git a/htdocs/core/lib/agenda.lib.php b/htdocs/core/lib/agenda.lib.php index 1c92cdf504e..f7d4cd430e3 100644 --- a/htdocs/core/lib/agenda.lib.php +++ b/htdocs/core/lib/agenda.lib.php @@ -384,6 +384,15 @@ function agenda_prepare_head() $head[$h][2] = 'extsites'; $h++; + complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda_admin'); + + $head[$h][0] = DOL_URL_ROOT."/admin/agenda_extrafields.php"; + $head[$h][1] = $langs->trans("ExtraFields"); + $head[$h][2] = 'attributes'; + $h++; + + complete_head_from_modules($conf,$langs,$object,$head,$h,'agenda_admin','remove'); + return $head; } diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index a897009d78b..e5e38fc5915 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -2523,6 +2523,7 @@ function price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerou // Clean parameters if (empty($amount)) $amount=0; // To have a numeric value if amount not defined or = '' + $amount = (is_numeric($amount)?$amount:0); // Check if amount is numeric, for example, an error occured when amount value = o (letter) instead 0 (number) if ($rounding < 0) $rounding=min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOT); $nbdecimal=$rounding; diff --git a/htdocs/core/tpl/login.tpl.php b/htdocs/core/tpl/login.tpl.php index 81d446281ae..0597896a07b 100644 --- a/htdocs/core/tpl/login.tpl.php +++ b/htdocs/core/tpl/login.tpl.php @@ -166,7 +166,9 @@ if ($forgetpasslink || $helpcenterlink) { } if ($helpcenterlink) { - echo ''; + $url=DOL_URL_ROOT.'/support/index.php'; + if (! empty($conf->global->MAIN_HELPCENTER_LINKTOUSE)) $url=$conf->global->MAIN_HELPCENTER_LINKTOUSE; + echo ''; if ($forgetpasslink) { echo ' - '; } else { diff --git a/htdocs/exports/export.php b/htdocs/exports/export.php index 6ffcc39e1c8..1f7c3eb64a0 100644 --- a/htdocs/exports/export.php +++ b/htdocs/exports/export.php @@ -817,7 +817,7 @@ if ($step == 4 && $datatoexport) $list=''; foreach($array_selected as $code=>$value) { - $list.=($list?', ':''); + $list.=(! empty($list)?', ':''); $list.=$langs->trans($objexport->array_export_fields[0][$code]); } print ''; @@ -828,15 +828,18 @@ if ($step == 4 && $datatoexport) { print ''; $list=''; - foreach($array_filtervalue as $code=>$value) + if (! empty($array_filtervalue)) { - if (isset($objexport->array_export_fields[0][$code])) + foreach($array_filtervalue as $code=>$value) { - $list.=($list?', ':''); - $list.=$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code])?$array_filtervalue[$code]:'')."'"; + if (isset($objexport->array_export_fields[0][$code])) + { + $list.=($list?', ':''); + $list.=$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code])?$array_filtervalue[$code]:'')."'"; + } } } - print ''; + print ''; print ''; } @@ -1046,7 +1049,7 @@ if ($step == 5 && $datatoexport) $list=''; foreach($array_selected as $code=>$label) { - $list.=($list?', ':''); + $list.=(! empty($list)?', ':''); $list.=$langs->trans($objexport->array_export_fields[0][$code]); } print ''; @@ -1056,15 +1059,18 @@ if ($step == 5 && $datatoexport) { print ''; $list=''; - foreach($array_filtervalue as $code=>$value) + if (! empty($array_filtervalue)) { - if (isset($objexport->array_export_fields[0][$code])) + foreach($array_filtervalue as $code=>$value) { - $list.=($list?', ':''); - $list.=$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code])?$array_filtervalue[$code]:'')."'"; + if (isset($objexport->array_export_fields[0][$code])) + { + $list.=($list?', ':''); + $list.=$langs->trans($objexport->array_export_fields[0][$code])."='".(isset($array_filtervalue[$code])?$array_filtervalue[$code]:'')."'"; + } } } - print ''; + print ''; print ''; } diff --git a/htdocs/langs/ca_ES/products.lang b/htdocs/langs/ca_ES/products.lang index 71d8d426d2c..0ed3a76fb1c 100644 --- a/htdocs/langs/ca_ES/products.lang +++ b/htdocs/langs/ca_ES/products.lang @@ -24,9 +24,9 @@ ProductsAndServicesNotOnSell=Productes i serveis fora de venda ProductsAndServicesStatistics=Estadístiques productes i serveis ProductsStatistics=Estadístiques productes ProductsOnSell=Productes en venda o compra -ProductsNotOnSell=Productes fora de venda o compra +ProductsNotOnSell=Productes fora de venda y compra ServicesOnSell=Serveis en venda o compra -ServicesNotOnSell=Serveis fora de venda o compra +ServicesNotOnSell=Serveis fora de venda y compra InternalRef=Referència interna LastRecorded=Ultims productes/serveis en venda registrats LastRecordedProductsAndServices=Els %s darrers productes/serveis registrats diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index a3c2bf41eb7..9afe2877e0e 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -24,9 +24,9 @@ ProductsAndServicesNotOnSell=Productos y servicios fuera de venta ProductsAndServicesStatistics=Estadísticas productos y servicios ProductsStatistics=Estadísticas productos ProductsOnSell=Productos en venta o en compra -ProductsNotOnSell=Productos fuera de venta o de compra +ProductsNotOnSell=Productos fuera de venta y de compra ServicesOnSell=Servicios en venta o en compra -ServicesNotOnSell=Servicios fuera de venta o de compra +ServicesNotOnSell=Servicios fuera de venta y de compra InternalRef=Referencia interna LastRecorded=Ultimos productos/servicios en venta registrados LastRecordedProductsAndServices=Los %s últimos productos/servicios registrados diff --git a/htdocs/langs/fr_FR/withdrawals.lang b/htdocs/langs/fr_FR/withdrawals.lang index 27c00e307cf..2654bab69a9 100644 --- a/htdocs/langs/fr_FR/withdrawals.lang +++ b/htdocs/langs/fr_FR/withdrawals.lang @@ -10,7 +10,7 @@ StandingOrderProcessed=Traités Withdrawals=Retraits Withdrawal=Retrait WithdrawalsReceipts=Bons de prélèvements -WithdrawalReceipt=Bon de prélèvement +WithdrawalReceipts=Bon de prélèvements WithdrawalReceiptShort=Bon LastWithdrawalReceipts=Les %s derniers bons de traitement WithdrawedBills=Factures prélevées @@ -82,7 +82,7 @@ ShowWithdraw=Voir prélèvement IfInvoiceNeedOnWithdrawPaymentWontBeClosed=Toutefois, si la facture a au moins un paiement par prélèvement non traité, elle ne le sera pas afin de permettre la gestion du prélèvement d'abord. DoStandingOrdersBeforePayments=Cet onglet permet de faire une demande de prélèvement bancaire. Une fois réalisé, vous pourrez saisir le paiement sur la facture pour la clore. WithdrawalFile=Fichier de prélèvement -SetToStatusSent=Mettre status "Fichier envoyé" +SetToStatusSent=Mettre statut "Fichier envoyé" ThisWillAlsoAddPaymentOnInvoice=Ceci créera également les paiements sur les factures et les classera payées ### Notifications diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 2e6cfbc083c..ba9ec57fea1 100755 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -29,6 +29,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/ws.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; dol_syslog("Call Dolibarr webservices interfaces"); @@ -82,14 +83,8 @@ $server->wsdl->addComplexType( ) ); -// Define other specific objects -$server->wsdl->addComplexType( - 'thirdparty', - 'complexType', - 'struct', - 'all', - '', - array( + +$thirdparty_fields= array( 'id' => array('name'=>'id','type'=>'xsd:string'), 'ref' => array('name'=>'name','type'=>'xsd:string'), 'ref_ext' => array('name'=>'ref_ext','type'=>'xsd:string'), @@ -123,8 +118,34 @@ $server->wsdl->addComplexType( 'profid6' => array('name'=>'profid6','type'=>'xsd:string'), 'capital' => array('name'=>'capital','type'=>'xsd:string'), 'vat_used' => array('name'=>'vat_used','type'=>'xsd:string'), - 'vat_number' => array('name'=>'vat_number','type'=>'xsd:string') - ) + 'vat_number' => array('name'=>'vat_number','type'=>'xsd:string')); + +//Retreive all extrafield for thirdsparty +// fetch optionals attributes and labels +$extrafields=new ExtraFields($db); +$extralabels=$extrafields->fetch_name_optionals_label('company'); +foreach($extrafields->attribute_label as $key=>$label) +{ + //$value=$object->array_options["options_".$key]; + $type =$extrafields->attribute_type[$key]; + if ($type=='date' || $type=='datetime') {$type='xsd:dateTime';} + else {$type='xsd:string';} + + $extrafield_array = array(); + + $extrafield_array[$key]=array('name'=>$key,'type'=>$type); +} + +$thirdparty_fields=array_merge($thirdparty_fields,$extrafield_array); + +// Define other specific objects +$server->wsdl->addComplexType( + 'thirdparty', + 'complexType', + 'struct', + 'all', + '', + $thirdparty_fields ); // Define other specific objects
'.$list.'
'.$langs->trans("FilteredFields").''.($list?$list:$langs->trans("None")).''.(! empty($list)?$list:$langs->trans("None")).'
'.$list.'
'.$langs->trans("FilteredFields").''.($list?$list:$langs->trans("None")).''.(! empty($list)?$list:$langs->trans("None")).'