diff --git a/ChangeLog b/ChangeLog index 892e37a9eda..803703caf9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,7 +30,7 @@ For users: - New: Add link to third party into sells and purchase journal. - New: Suggest a method to generate a backup file for user with no access to mysqldump binary. -- New: Can use extrafields on contacts/addresses. +- New: Can also use extrafields on contacts/addresses and users. - New: Support unique field for extrafields. - New: Extra fields supports more types (int, string, double, date, datetime). - New: Can correct stock of a warehouse from warehouse card. @@ -62,10 +62,12 @@ 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 experimental modules: - New: Add margin management module. - New: Add commissions management module. + - Fix: [ bug #499 ]: Supplier order input method not translated - Fix: No images into product description lines as PDF generation does not work with this. diff --git a/build/debian/apache.conf b/build/debian/apache.conf index 249c100245d..560a1c5193c 100644 --- a/build/debian/apache.conf +++ b/build/debian/apache.conf @@ -34,16 +34,6 @@ Alias /dolibarr /usr/share/dolibarr/htdocs - # OPTIMIZE: To use gzip compressed files (for Dolibarr already compressed files). - # Note that constant MAIN_OPTIMIZE_SPEED must have a value with bit 0 set. - #AddType text/javascript .jgz - #AddEncoding gzip .jgz - - # OPTIMIZE: To use gzip compression (on the fly). - # Note that you must also enable the module mod_deflate. - # You can also set this with constant MAIN_OPTIMIZE_SPEED and bit 2 set. - #TODO - # OPTIMIZE: To use cache on static pages (A259200 = 1 month). # Note that you must also enable the module mod_expires. #ExpiresActive On diff --git a/build/debian/conf.php.install b/build/debian/conf.php.install index 78195f27006..e439e80caef 100755 --- a/build/debian/conf.php.install +++ b/build/debian/conf.php.install @@ -161,12 +161,11 @@ $dolibarr_main_authentication='dolibarr'; # $dolibarr_main_auth_ldap_filter = ''; # If defined, two previous parameters are not used to find a user into LDAP. Ex: (uid=%1%) or &(uid=%1%)(isMemberOf=cn=Sales,ou=Groups,dc=opencsi,dc=com). # $dolibarr_main_auth_ldap_admin_login=''; # Required only if anonymous bind disabled. Ex: cn=admin,dc=example,dc=com # $dolibarr_main_auth_ldap_admin_pass=''; # Required only if anonymous bind disabled. Ex: secret - # $dolibarr_main_auth_ldap_debug='false'; # dolibarr_main_demo -# Login and pass to use in a demo mode +# Login and pass to use in a demo mode. # Default value: '' # Examples: # $dolibarr_main_demo='autologin,autopass' diff --git a/build/debian/control.debianbin b/build/debian/control.debianbin deleted file mode 100755 index 39fe764e088..00000000000 --- a/build/debian/control.debianbin +++ /dev/null @@ -1,55 +0,0 @@ -Package: dolibarr -Version: __VERSION__ -Architecture: all -Maintainer: Laurent Destailleur -Installed-Size: 61200 -Depends: libapache2-mod-php5 | libapache2-mod-php5filter | php5-cgi | php5-fpm | php5, - php5-mysql | php5-mysqli, - php5-cli, php5-curl, php5-gd, php5-ldap, php-pear, php-mail-mime, php5-geoip, - libphp-adodb, - libnusoap-php, - libphp-pclzip, - libjs-jquery, libjs-jquery-ui, ckeditor, - ttf-dejavu-core, - xdg-utils, - mysql-server -Section: web -Priority: optional -Homepage: http://www.dolibarr.org -Description: Web based software to manage a small company or foundation - Dolibarr ERP & CRM is an easy to use open source/free software for small - and medium companies, foundations or freelances. It includes different - features for Enterprise Resource Planning (ERP) and Customer Relationship - Management (CRM) but also for different other activities. - It's a web software you can install as a standalone program or on any web - hosting provider to use it from anywhere with any web browser. - . - Dolibarr was designed to be easy to use. Only features you need are - visible, depending on which module were activated. - Most common used modules are: - . - Customers, Suppliers or Prospects directory, - Contacts directory, - Orders management, - Commercial proposals management, - Invoices management, - Products and services catalog, - Stock management, - Foundations members management, - Bank accounts management, - Point of Sale, - Payments management, - Commercial actions management, - Contracts management, - Standing orders management, - Shipping management, - Donations management, - Bookmarks management, - Mass Emailings, - Reports, - Wizards to export and import data, - LDAP connectivity, - PDF exports, - And a lot of more modules... - . - You can also add third parties external modules or develop yours. diff --git a/build/debian/install.forced.php.install b/build/debian/install.forced.php.install index c62d4760d23..3977caf8430 100755 --- a/build/debian/install.forced.php.install +++ b/build/debian/install.forced.php.install @@ -29,13 +29,14 @@ $force_install_lockinstall='444'; // If we enable/disable libraries declaration during install, we must also check they are // not removed from package (see in rules file), // declared into dependencies (see in control file) +$force_dolibarr_lib_TCPDF_PATH=''; +$force_dolibarr_lib_FPDF_PATH='/usr/share/php/fpdf'; +$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; $force_dolibarr_lib_ADODB_PATH='/usr/share/php/adodb'; -//$force_dolibarr_lib_FPDI_PATH='/usr/share/php/fpdi'; $force_dolibarr_lib_GEOIP_PATH=''; $force_dolibarr_lib_NUSOAP_PATH='/usr/share/php/nusoap'; $force_dolibarr_lib_ODTPHP_PATHTOPCLZIP='/usr/share/php/libphp-pclzip'; $force_dolibarr_lib_PHPEXCEL_PATH=''; -$force_dolibarr_lib_TCPDF_PATH=''; $force_dolibarr_js_CKEDITOR='/javascript/ckeditor'; $force_dolibarr_js_JQUERY='/javascript/jquery'; $force_dolibarr_js_JQUERY_UI='/javascript/jquery-ui'; diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index b1838928511..30158915f2e 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -547,7 +547,7 @@ if ($action == 'edit' || $action == 'updateedit') /* * Local Taxes */ - if ($mysoc->country_code=='ES') + if ($mysoc->hasLocalTax(1)) { // Local Tax 1 print '
'; @@ -576,7 +576,9 @@ if ($action == 'edit' || $action == 'updateedit') print ""; print "\n"; print ""; - + } + if ($mysoc->hasLocalTax(2)) + { // Local Tax 2 print '
'; print ''; @@ -921,7 +923,7 @@ else /* * Local Taxes */ - if ($mysoc->country_code=='ES') + if ($mysoc->hasLocalTax(1)) { // Local Tax 1 print '
'; @@ -951,7 +953,9 @@ else print "\n"; print "
"; - + } + if ($mysoc->hasLocalTax(2)) + { // Local Tax 2 print '
'; print ''; diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index bf9bec788d4..efa6c30c6e2 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -27,7 +27,9 @@ */ require '../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; $langs->load("admin"); $langs->load("members"); @@ -35,6 +37,9 @@ $langs->load("users"); if (! $user->admin) accessforbidden(); +$extrafields = new ExtraFields($db); + + /* * Action */ @@ -71,14 +76,17 @@ if (preg_match('/del_(.*)/',$action,$reg)) * View */ -llxHeader(); +$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; +llxHeader('',$langs->trans("UsersSetup"),$help_url); $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("UsersSetup"),$linkback,'setup'); -print "
"; -print_fiche_titre($langs->trans("MemberMainOptions"),'',''); +$head=user_admin_prepare_head(); + +dol_fiche_head($head,'card', $langs->trans("User"), 0, 'user'); + print '
'; print ''; print ''; @@ -114,7 +122,8 @@ else print ''; print '
'.$langs->trans("Description").'
'; -print '

'; + +dol_fiche_end(); llxFooter(); $db->close(); diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 0df445e2b28..36dae818cfa 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -1565,21 +1565,19 @@ print ''.price($object->total_tva).''; print ''.$langs->trans("Currency".$conf->currency).''; // Amount Local Taxes -if ($mysoc->country_code=='ES') +if ($mysoc->localtax1_assuj=="1") //Localtax1 { - if ($mysoc->localtax1_assuj=="1") //Localtax1 RE - { - print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; - print ''.price($object->total_localtax1).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } - if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF - { - print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; - print ''.price($object->total_localtax2).''; - print ''.$langs->trans("Currency".$conf->currency).''; - } + print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''; + print ''.price($object->total_localtax1).''; + print ''.$langs->trans("Currency".$conf->currency).''; } +if ($mysoc->localtax2_assuj=="1") //Localtax2 +{ + print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''; + print ''.price($object->total_localtax2).''; + print ''.$langs->trans("Currency".$conf->currency).''; +} + // Amount TTC print ''.$langs->trans('AmountTTC').''; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 3f77370edf5..e7533d0055d 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -1581,18 +1581,16 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1).''; print ''.$langs->trans('TotalHT').''.price($objectsrc->total_ht).''; print ''.$langs->trans('TotalVAT').''.price($objectsrc->total_tva).""; - if ($mysoc->country_code=='ES') + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE { - if ($mysoc->localtax1_assuj=="1") //Localtax1 RE - { - print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($objectsrc->total_localtax1).""; - } - - if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF - { - print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($objectsrc->total_localtax2).""; - } + print ''.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($objectsrc->total_localtax1).""; } + + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($objectsrc->total_localtax2).""; + } + print ''.$langs->trans('TotalTTC').''.price($objectsrc->total_ttc).""; } else @@ -1814,11 +1812,8 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G if (! empty($conf->projet->enabled)) $nbrow++; //Local taxes - if ($mysoc->country_code=='ES') - { - if($mysoc->localtax1_assuj=="1") $nbrow++; - if($mysoc->localtax2_assuj=="1") $nbrow++; - } + if($mysoc->localtax1_assuj=="1") $nbrow++; + if($mysoc->localtax2_assuj=="1") $nbrow++; print ''; @@ -2075,20 +2070,17 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G print ''; // Amount Local Taxes - if ($mysoc->country_code=='ES') + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE { - if ($mysoc->localtax1_assuj=="1") //Localtax1 RE - { - print ''; - print ''; - print ''; - } - if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF - { - print ''; - print ''; - print ''; - } + print ''; + print ''; + print ''; + } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print ''; + print ''; + print ''; } // Total TTC diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 67194b610d5..a66f53f7458 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -757,6 +757,7 @@ else if ($action == 'add' && $user->rights->facture->creer) $object->amount = $_POST['amount']; $object->remise_absolue = $_POST['remise_absolue']; $object->remise_percent = $_POST['remise_percent']; + $object->fetch_thirdparty(); // If creation from another object of another module (Example: origin=propal, originid=1) if ($_POST['origin'] && $_POST['originid']) @@ -2078,17 +2079,14 @@ if ($action == 'create') print ''; print ''; print '"; - if ($mysoc->pays_code=='ES') + if ($mysoc->localtax1_assuj=="1") //Localtax1 RE { - if ($mysoc->localtax1_assuj=="1") //Localtax1 RE - { - print '"; - } + print '"; + } - if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF - { - print '"; - } + if ($mysoc->localtax2_assuj=="1") //Localtax2 IRPF + { + print '"; } print '"; } @@ -2654,11 +2652,8 @@ else if ($id > 0 || ! empty($ref)) if (! empty($conf->banque->enabled)) $nbcols++; //Local taxes - if ($mysoc->pays_code=='ES') - { - if($mysoc->localtax1_assuj=="1") $nbrows++; - if($mysoc->localtax2_assuj=="1") $nbrows++; - } + if($mysoc->localtax1_assuj=="1") $nbrows++; + if($mysoc->localtax2_assuj=="1") $nbrows++; print 'margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; ?> -global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; -} + @@ -63,7 +62,7 @@ if (! empty($conf->margin->enabled)) { @@ -97,17 +96,16 @@ jQuery(document).ready(function() { margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; ?> global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; } ?> -service->enabled) && $dateSelector) { -if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) - $colspan = 10; -else - $colspan = 9; -if (! empty($conf->margin->enabled)) { - $colspan++; // For the buying price - if (! empty($conf->global->DISPLAY_MARGIN_RATES)) - $colspan++; - if (! empty($conf->global->DISPLAY_MARK_RATES)) - $colspan++; -} +service->enabled) && $dateSelector) +{ + if (! empty($conf->global->MAIN_VIEW_LINE_NUMBER)) $colspan = 10; + else $colspan = 9; + if (! empty($conf->margin->enabled)) + { + $colspan++; // For the buying price + if (! empty($conf->global->DISPLAY_MARGIN_RATES)) $colspan++; + if (! empty($conf->global->DISPLAY_MARK_RATES)) $colspan++; + } ?> > - + + margin->enabled)) { +if (! empty($conf->margin->enabled)) +{ ?> - + diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index 62eec4ebaaf..ba260ea4f19 100755 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -207,6 +207,7 @@ define('MAIN_DB_PREFIX',$dolibarr_main_db_prefix); // Path to root libraries if (! defined('ADODB_PATH')) { define('ADODB_PATH', (!isset($dolibarr_lib_ADODB_PATH))?DOL_DOCUMENT_ROOT.'/includes/adodbtime/':(empty($dolibarr_lib_ADODB_PATH)?'':$dolibarr_lib_ADODB_PATH.'/')); } if (! defined('TCPDF_PATH')) { define('TCPDF_PATH', (!isset($dolibarr_lib_TCPDF_PATH))?DOL_DOCUMENT_ROOT.'/includes/tcpdf/':(empty($dolibarr_lib_TCPDF_PATH)?'':$dolibarr_lib_TCPDF_PATH.'/')); } +if (! defined('FPDF_PATH')) { define('FPDF_PATH', (!isset($dolibarr_lib_FPDF_PATH))?DOL_DOCUMENT_ROOT.'/includes/fpdf/':(empty($dolibarr_lib_FPDF_PATH)?'':$dolibarr_lib_FPDF_PATH.'/')); } // Used only for package that can't include tcpdf if (! defined('FPDI_PATH')) { define('FPDI_PATH', (!isset($dolibarr_lib_FPDI_PATH))?DOL_DOCUMENT_ROOT.'/includes/fpdfi/':(empty($dolibarr_lib_FPDI_PATH)?'':$dolibarr_lib_FPDI_PATH.'/')); } if (! defined('NUSOAP_PATH')) { define('NUSOAP_PATH', (!isset($dolibarr_lib_NUSOAP_PATH))?DOL_DOCUMENT_ROOT.'/includes/nusoap/lib/':(empty($dolibarr_lib_NUSOAP_PATH)?'':$dolibarr_lib_NUSOAP_PATH.'/')); } if (! defined('PHPEXCEL_PATH')) { define('PHPEXCEL_PATH', (!isset($dolibarr_lib_PHPEXCEL_PATH))?DOL_DOCUMENT_ROOT.'/includes/phpexcel/':(empty($dolibarr_lib_PHPEXCEL_PATH)?'':$dolibarr_lib_PHPEXCEL_PATH.'/')); } diff --git a/htdocs/fourn/commande/fiche.php b/htdocs/fourn/commande/fiche.php index c57d9e12bfc..e9e11a5d557 100644 --- a/htdocs/fourn/commande/fiche.php +++ b/htdocs/fourn/commande/fiche.php @@ -1461,12 +1461,22 @@ if ($id > 0 || ! empty($ref)) print ''; print ''; + // TODO Use the predefinedproductline_create.tpl.php file + // Add free products/services form print ''; print ''; print ''; print ''; + print ''; + $var=true; print ''; print ''; print ''; + // TODO Use the predefinedproductline_create.tpl.php file print ''; print ''; print ''; print ''; + + print ''; + $var=! $var; print ''; print '\n"; - // Autres caracteristiques issus des autres modules - + // Other attributes + $parameters=array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } + } + // Module Webcalendar // TODO external module if (! empty($conf->webcalendar->enabled)) @@ -888,19 +918,20 @@ else if ($id) { - $fuser = new User($db); - $fuser->fetch($id); - + $object->fetch($id); + if ($res < 0) { dol_print_error($db,$object->error); exit; } + $res=$object->fetch_optionals($object->id,$extralabels); + // Connexion ldap // pour recuperer passDoNotExpire et userChangePassNextLogon - if (! empty($conf->ldap->enabled) && ! empty($fuser->ldap_sid)) + if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) { $ldap = new Ldap(); $result=$ldap->connect_bind(); if ($result > 0) { - $userSearchFilter = '('.$conf->global->LDAP_FILTER_CONNECTION.'('.$ldap->getUserIdentifier().'='.$fuser->login.'))'; - $entries = $ldap->fetch($fuser->login,$userSearchFilter); + $userSearchFilter = '('.$conf->global->LDAP_FILTER_CONNECTION.'('.$ldap->getUserIdentifier().'='.$object->login.'))'; + $entries = $ldap->fetch($object->login,$userSearchFilter); if (! $entries) { $message .= $ldap->error; @@ -937,7 +968,7 @@ else } // Show tabs - $head = user_prepare_head($fuser); + $head = user_prepare_head($object); $title = $langs->trans("User"); dol_fiche_head($head, 'user', $title, 0, 'user'); @@ -947,7 +978,7 @@ else */ if ($action == 'password') { - $ret=$form->form_confirm("fiche.php?id=$fuser->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$fuser->login),"confirm_password", '', 0, 1); + $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("ReinitPassword"),$langs->trans("ConfirmReinitPassword",$object->login),"confirm_password", '', 0, 1); if ($ret == 'html') print '
'; } @@ -956,7 +987,7 @@ else */ if ($action == 'passwordsend') { - $ret=$form->form_confirm("fiche.php?id=$fuser->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$fuser->login),"confirm_passwordsend", '', 0, 1); + $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("SendNewPassword"),$langs->trans("ConfirmSendNewPassword",$object->login),"confirm_passwordsend", '', 0, 1); if ($ret == 'html') print '
'; } @@ -965,7 +996,7 @@ else */ if ($action == 'disable') { - $ret=$form->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$fuser->login),"confirm_disable", '', 0, 1); + $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DisableAUser"),$langs->trans("ConfirmDisableUser",$object->login),"confirm_disable", '', 0, 1); if ($ret == 'html') print '
'; } @@ -974,7 +1005,7 @@ else */ if ($action == 'enable') { - $ret=$form->form_confirm("fiche.php?id=$fuser->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$fuser->login),"confirm_enable", '', 0, 1); + $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("EnableAUser"),$langs->trans("ConfirmEnableUser",$object->login),"confirm_enable", '', 0, 1); if ($ret == 'html') print '
'; } @@ -983,7 +1014,7 @@ else */ if ($action == 'delete') { - $ret=$form->form_confirm("fiche.php?id=$fuser->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$fuser->login),"confirm_delete", '', 0, 1); + $ret=$form->form_confirm("fiche.php?id=$object->id",$langs->trans("DeleteAUser"),$langs->trans("ConfirmDeleteUser",$object->login),"confirm_delete", '', 0, 1); if ($ret == 'html') print '
'; } @@ -999,52 +1030,54 @@ else // Ref print ''; print ''; print ''."\n"; - $rowspan=14; + $rowspan=15; + if (isset($conf->authmode) && preg_match('/myopenid/',$conf->authmode)) $rowspan++; if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; if (! empty($conf->webcalendar->enabled)) $rowspan++; // TODO external module if (! empty($conf->phenix->enabled)) $rowspan+=2; // TODO external module + // Lastname print ''; - print ''; + print ''; // Photo print ''; print ''."\n"; // Firstname print ''; - print ''; + print ''; print ''."\n"; // Position/Job print ''; - print ''; + print ''; print ''."\n"; // Login print ''; - if (! empty($fuser->ldap_sid) && $fuser->statut==0) + if (! empty($object->ldap_sid) && $object->statut==0) { print ''; } else { - print ''; + print ''; } print ''."\n"; // Password print ''; - if (! empty($fuser->ldap_sid)) + if (! empty($object->ldap_sid)) { if ($passDoNotExpire) { @@ -1066,10 +1099,10 @@ else else { print '"; @@ -1078,17 +1111,17 @@ else // Administrator print ''."\n"; @@ -1096,13 +1129,13 @@ else if (! empty($conf->multicompany->enabled) && empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) { print '\n"; @@ -1110,11 +1143,11 @@ else // Type print ''; - print ''; + print ''; print ''."\n"; // Tel mobile print ''; - print ''; + print ''; print ''."\n"; // Fax print ''; - print ''; + print ''; print ''."\n"; // EMail print ''; - print ''; + print ''; print "\n"; // Signature print '\n"; // Statut print ''; print ''; print ''."\n"; print ''; - print ''; + print ''; print "\n"; print ''; - print ''; + print ''; print "\n"; if (isset($conf->authmode) && preg_match('/myopenid/',$conf->authmode)) { print ''; - print ''; + print ''; print "\n"; } - // Autres caracteristiques issus des autres modules // Module Webcalendar // TODO external module @@ -1179,7 +1211,7 @@ else { $langs->load("other"); print ''; - print ''; + print ''; print ''."\n"; } @@ -1189,10 +1221,10 @@ else { $langs->load("other"); print ''; - print ''; + print ''; print "\n"; print ''; - print ''; + print ''; print ''."\n"; } @@ -1201,23 +1233,23 @@ else { print ''; print ''; print ''."\n"; @@ -1229,10 +1261,10 @@ else $langs->load("members"); print ''; print ''."\n"; } - print "
'.$langs->trans('Currency'.$conf->currency).'
'.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1).''.$langs->trans("Currency".$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2).''.$langs->trans("Currency".$conf->currency).'
'.$langs->transcountry("AmountLT1",$mysoc->country_code).''.price($object->total_localtax1).''.$langs->trans("Currency".$conf->currency).'
'.$langs->transcountry("AmountLT2",$mysoc->country_code).''.price($object->total_localtax2).''.$langs->trans("Currency".$conf->currency).'
'.$langs->trans($newclassname).''.$objectsrc->getNomUrl(1).'
'.$langs->trans('TotalHT').''.price($objectsrc->total_ht).'
'.$langs->trans('TotalVAT').''.price($objectsrc->total_tva)."
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($objectsrc->total_localtax1)."
'.$langs->transcountry("AmountLT1",$mysoc->pays_code).''.price($objectsrc->total_localtax1)."
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($objectsrc->total_localtax2)."
'.$langs->transcountry("AmountLT2",$mysoc->pays_code).''.price($objectsrc->total_localtax2)."
'.$langs->trans('TotalTTC').''.price($objectsrc->total_ttc)."
'; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index 4e2d80e7bd1..fd8a2c82101 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -127,6 +127,7 @@ class Contact extends CommonObject $sql.= ", priv"; $sql.= ", canvas"; $sql.= ", entity"; + $sql.= ", import_key"; $sql.= ") VALUES ("; $sql.= "'".$this->db->idate($now)."',"; if ($this->socid > 0) $sql.= " ".$this->socid.","; @@ -136,7 +137,8 @@ class Contact extends CommonObject $sql.= " ".($user->id > 0 ? "'".$user->id."'":"null").","; $sql.= " ".$this->priv.","; $sql.= " ".($this->canvas?"'".$this->canvas."'":"null").","; - $sql.= " ".$conf->entity; + $sql.= " ".$conf->entity.","; + $sql.= " ".$this->import_key; $sql.= ")"; dol_syslog(get_class($this)."::create sql=".$sql); diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 0cb132d23c6..600bd44d95c 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1516,27 +1516,49 @@ abstract class CommonObject $this->total_localtax2 += $obj->total_localtax2; $this->total_ttc += $obj->total_ttc; - // Define vatrates with totals for each line and for all lines - // TODO $vatrates and $vatrates_alllines not used ? - if (! empty($this->vatrate)) + // Check if global invoice tax for this vat rate + if (! empty($obj->vatrate)) { - $vatrates[$this->vatrate][]=array( - 'total_ht' =>$obj->total_ht, - 'total_tva' =>$obj->total_tva, - 'total_ttc' =>$obj->total_ttc, - 'total_localtax1'=>$obj->total_localtax1, - 'total_localtax2'=>$obj->total_localtax2 - ); - if (! isset($vatrates_alllines[$this->vatrate]['total_ht'])) $vatrates_alllines[$this->vatrate]['total_ht']=0; - if (! isset($vatrates_alllines[$this->vatrate]['total_tva'])) $vatrates_alllines[$this->vatrate]['total_tva']=0; - if (! isset($vatrates_alllines[$this->vatrate]['total_localtax1'])) $vatrates_alllines[$this->vatrate]['total_localtax1']=0; - if (! isset($vatrates_alllines[$this->vatrate]['total_localtax2'])) $vatrates_alllines[$this->vatrate]['total_localtax2']=0; - if (! isset($vatrates_alllines[$this->vatrate]['total_ttc'])) $vatrates_alllines[$this->vatrate]['total_ttc']=0; - $vatrates_alllines[$this->vatrate]['total_ht'] +=$obj->total_ht; - $vatrates_alllines[$this->vatrate]['total_tva'] +=$obj->total_tva; - $vatrates_alllines[$this->vatrate]['total_localtax1']+=$obj->total_localtax1; - $vatrates_alllines[$this->vatrate]['total_localtax2']+=$obj->total_localtax2; - $vatrates_alllines[$this->vatrate]['total_ttc'] +=$obj->total_ttc; + if ($this->total_localtax1 == 0) + { + // Search local taxes + $sql = "SELECT t.localtax1, t.localtax1_type"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; + $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->client->country_code."'"; + $sql .= " AND t.taux = ".$obj->vatrate." AND t.active = 1"; + + dol_syslog("get_localtax sql=".$sql); + $resqlt=$this->db->query($sql); + if ($resqlt) + { + $objt = $this->db->fetch_object($resqlt); + if ($objt->localtax1_type == '7') + { + $this->total_localtax1 += $objt->localtax1; + $this->total_ttc += $objt->localtax1; + } + } + } + if ($this->total_localtax2 == 0) + { + // Search local taxes + $sql = "SELECT t.localtax2, t.localtax2_type"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; + $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->client->country_code."'"; + $sql .= " AND t.taux = ".$obj->vatrate." AND t.active = 1"; + + dol_syslog("get_localtax sql=".$sql); + $resqlt=$this->db->query($sql); + if ($resqlt) + { + $objt = $this->db->fetch_object($resqlt); + if ($objt->localtax2_type == '7') + { + $this->total_localtax2 += $objt->localtax2; + $this->total_ttc += $objt->localtax2; + } + } + } } $i++; @@ -1544,21 +1566,6 @@ abstract class CommonObject $this->db->free($resql); - // TODO - if ($roundingadjust) - { - // For each vatrate, calculate if two method of calculation differs - - - // If it differs - if (1==2) - { - // Adjust a line and update it - - - } - } - // Now update global field total_ht, total_ttc and tva $fieldht='total_ht'; $fieldtva='tva'; diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index 136d034a0ec..cf3c7b8ba96 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -115,7 +115,8 @@ class HookManager * @param Object &$object Object to use hooks on * @param string &$action Action code on calling page ('create', 'edit', 'view', 'add', 'update', 'delete'...) * @return mixed For doActions,formObjectOptions: Return 0 if we want to keep standard actions, >0 if if want to stop standard actions, <0 means KO. - * For printSearchForm,printLeftBlock,printTopRightMenu,...: Return HTML string. + * For printSearchForm,printLeftBlock,printTopRightMenu,formAddObjectLine,...: Return HTML string. TODO Must always return an int and things to print into ->resprints. + * Can also return some values into an array ->results. * $this->error or this->errors are also defined by class called by this function if error. */ function executeHooks($method, $parameters=false, &$object='', &$action='') @@ -127,45 +128,58 @@ class HookManager // Loop on each hook to qualify modules that declared context $modulealreadyexecuted=array(); - $resaction=0; $resprint=''; + $resaction=0; $error=0; + $this->resPrint=''; $this->resArray=array(); foreach($this->hooks as $modules) // this->hooks is an array with context as key and value is an array of modules that handle this context { if (! empty($modules)) { foreach($modules as $module => $actionclassinstance) { - // test to avoid to run twice a hook, when a module implements several active contexts + // jump to next class if method does not exists + if (! method_exists($actionclassinstance,$method)) continue; + // test to avoid to run twice a hook, when a module implements several active contexts if (in_array($module,$modulealreadyexecuted)) continue; $modulealreadyexecuted[$module]=$module; // Hooks that return int - if (($method == 'doActions' || $method == 'formObjectOptions') && method_exists($actionclassinstance,$method)) + if (($method == 'doActions' || $method == 'formObjectOptions')) { - $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)) - { - $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); - if ($method == 'doActions') - { - if ($action=='add') $action='create'; // TODO this change must be inside the doActions - if ($action=='update') $action='edit'; // TODO this change must be inside the doActions - } - } + $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)) + { + $error++; + $this->error=$actionclassinstance->error; $this->errors=array_merge($this->errors, (array) $actionclassinstance->errors); + // TODO remove this. Change must be inside the method if required + if ($method == 'doActions') + { + if ($action=='add') $action='create'; + if ($action=='update') $action='edit'; + } + } } - // Generic hooks that return a string (printSearchForm, printLeftBlock, formBuilddocOptions, ...) - else if (method_exists($actionclassinstance,$method)) + // Generic hooks that return a string (printSearchForm, printLeftBlock, printTopRightMenu, formAddObjectLine, formBuilddocOptions, ...) + else { - if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; + // TODO. this should be done into the method by returning nothing + if (is_array($parameters) && ! empty($parameters['special_code']) && $parameters['special_code'] > 3 && $parameters['special_code'] != $actionclassinstance->module_number) continue; + $result = $actionclassinstance->$method($parameters, $object, $action, $this); - if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); - else $resprint.=$result; + + if (is_array($actionclassinstance->results)) $this->resArray =array_merge($this->resArray, $actionclassinstance->results); + if (! empty($actionclassinstance->resprints)) $this->resPrint.=$actionclassinstance->resprints; + + // TODO. remove this. array result must be set into $actionclassinstance->results + if (is_array($result)) $this->resArray = array_merge($this->resArray, $result); + // TODO. remove this. result must not be a string. we must use $actionclassinstance->resprint to return a string + if (! is_array($result) && ! is_numeric($result)) $this->resPrint.=$result; } } } } - if ($method == 'doActions' || $method == 'formObjectOptions') return $resaction; - return $resprint; + if ($method != 'doActions' && $method != 'formObjectOptions') return $this->resPrint; // TODO remove this. When there is something to print, ->resPrint is filled. + return ($error?-1:$resaction); } } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 838c94f0c6d..8c4f24f3f28 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -1541,7 +1541,8 @@ class Form $num = $this->db->num_rows($result); - $outselect.=''; // remove select to have id same with combo and ajax + $outselect.='trans('ReductionShort'); ?> trans('BuyingPrice'); ?>  
% "> @@ -115,18 +113,17 @@ if (! empty($conf->margin->enabled)) {
@@ -138,11 +135,15 @@ if (! empty($conf->margin->enabled)) { ?>
 
'; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 4e3d60848f6..648df36f946 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -466,10 +466,19 @@ elseif ($action == 'addline') } $ret=$object->fetch_thirdparty(); - if ($_POST['idprodfournprice']) // > 0 or -1 + if (GETPOST('search_idprodfournprice') || GETPOST('idprodfournprice')) // With combolist idprodfournprice is > 0 or -1, with autocomplete, idprodfournprice is > 0 or '' { - $product=new Product($db); - $idprod=$product->get_buyprice($_POST['idprodfournprice'], $_POST['qty']); // Just to see if a price exists for the quantity. Not used to found vat + $idprod=0; + $product=new Product($db); + + if (GETPOST('idprodfournprice') == '') + { + $idprod=-1; + } + if (GETPOST('idprodfournprice') > 0) + { + $idprod=$product->get_buyprice(GETPOST('idprodfournprice'), $_POST['qty']); // Just to see if a price exists for the quantity. Not used to found vat + } if ($idprod > 0) { @@ -1805,10 +1814,20 @@ else print ' 
'; diff --git a/htdocs/install/etape1.php b/htdocs/install/etape1.php index 56fe19f37eb..c566735c3e3 100644 --- a/htdocs/install/etape1.php +++ b/htdocs/install/etape1.php @@ -874,6 +874,15 @@ function write_conf_file($conffile) // Write params to overwrites default lib path fputs($fp,"\n"); + if (empty($force_dolibarr_lib_TCPDF_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_TCPDF_PATH=''; } + fputs($fp, '$dolibarr_lib_TCPDF_PATH=\''.$force_dolibarr_lib_TCPDF_PATH.'\';'); + fputs($fp,"\n"); + if (empty($force_dolibarr_lib_FPDF_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_FPDF_PATH=''; } + fputs($fp, '$dolibarr_lib_FPDF_PATH=\''.$force_dolibarr_lib_FPDF_PATH.'\';'); + fputs($fp,"\n"); + if (empty($force_dolibarr_lib_FPDI_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_FPDI_PATH=''; } + fputs($fp, '$dolibarr_lib_FPDI_PATH=\''.$force_dolibarr_lib_FPDI_PATH.'\';'); + fputs($fp,"\n"); if (empty($force_dolibarr_lib_ADODB_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_ADODB_PATH=''; } fputs($fp, '$dolibarr_lib_ADODB_PATH=\''.$force_dolibarr_lib_ADODB_PATH.'\';'); fputs($fp,"\n"); @@ -883,9 +892,6 @@ function write_conf_file($conffile) if (empty($force_dolibarr_lib_NUSOAP_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_NUSOAP_PATH=''; } fputs($fp, '$dolibarr_lib_NUSOAP_PATH=\''.$force_dolibarr_lib_NUSOAP_PATH.'\';'); fputs($fp,"\n"); - if (empty($force_dolibarr_lib_FPDI_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_FPDI_PATH=''; } - fputs($fp, '$dolibarr_lib_FPDI_PATH=\''.$force_dolibarr_lib_FPDI_PATH.'\';'); - fputs($fp,"\n"); if (empty($force_dolibarr_lib_PHPEXCEL_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_PHPEXCEL_PATH=''; } fputs($fp, '$dolibarr_lib_PHPEXCEL_PATH=\''.$force_dolibarr_lib_PHPEXCEL_PATH.'\';'); fputs($fp,"\n"); @@ -895,9 +901,6 @@ function write_conf_file($conffile) if (empty($force_dolibarr_lib_ODTPHP_PATHTOPCLZIP)) { fputs($fp, '//'); $force_dolibarr_lib_ODTPHP_PATHTOPCLZIP=''; } fputs($fp, '$dolibarr_lib_ODTPHP_PATHTOPCLZIP=\''.$force_dolibarr_lib_ODTPHP_PATHTOPCLZIP.'\';'); fputs($fp,"\n"); - if (empty($force_dolibarr_lib_TCPDF_PATH)) { fputs($fp, '//'); $force_dolibarr_lib_TCPDF_PATH=''; } - fputs($fp, '$dolibarr_lib_TCPDF_PATH=\''.$force_dolibarr_lib_TCPDF_PATH.'\';'); - fputs($fp,"\n"); if (empty($force_dolibarr_js_CKEDITOR)) { fputs($fp, '//'); $force_dolibarr_js_CKEDITOR=''; } fputs($fp, '$dolibarr_js_CKEDITOR=\''.$force_dolibarr_js_CKEDITOR.'\';'); fputs($fp,"\n"); diff --git a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql index 014093ee5ba..607b57c0d26 100755 --- a/htdocs/install/mysql/migration/3.2.0-3.3.0.sql +++ b/htdocs/install/mysql/migration/3.2.0-3.3.0.sql @@ -857,3 +857,13 @@ INSERT INTO llx_c_paper_format (rowid, code, label, width, height, unit, active) -- increase field size ALTER TABLE llx_bank_account MODIFY COLUMN code_banque varchar(8); + +create table llx_user_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, -- member id + import_key varchar(14) -- import key +)ENGINE=innodb; + +ALTER TABLE llx_user_extrafields ADD INDEX idx_user_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_user_extrafields.key.sql b/htdocs/install/mysql/tables/llx_user_extrafields.key.sql new file mode 100644 index 00000000000..a4af69a614a --- /dev/null +++ b/htdocs/install/mysql/tables/llx_user_extrafields.key.sql @@ -0,0 +1,23 @@ +-- =================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2002-2003 Jean-Louis Bergamo +-- Copyright (C) 2009 Regis Houssin +-- Copyright (C) 2011 Laurent Destailleur +-- +-- 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 . +-- +-- =================================================================== + + +ALTER TABLE llx_user_extrafields ADD INDEX idx_user_extrafields (fk_object); diff --git a/htdocs/install/mysql/tables/llx_user_extrafields.sql b/htdocs/install/mysql/tables/llx_user_extrafields.sql new file mode 100644 index 00000000000..96b4ec69601 --- /dev/null +++ b/htdocs/install/mysql/tables/llx_user_extrafields.sql @@ -0,0 +1,27 @@ +-- =================================================================== +-- Copyright (C) 2002-2003 Rodolphe Quiedeville +-- Copyright (C) 2002-2003 Jean-Louis Bergamo +-- Copyright (C) 2009 Regis Houssin +-- +-- 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 . +-- +-- =================================================================== + +create table llx_user_extrafields +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + tms timestamp, + fk_object integer NOT NULL, -- member id + import_key varchar(14) -- import key +)ENGINE=innodb; diff --git a/htdocs/langs/ar_SA/suppliers.lang b/htdocs/langs/ar_SA/suppliers.lang index 5929a7d55d3..c4ac7827029 100644 --- a/htdocs/langs/ar_SA/suppliers.lang +++ b/htdocs/langs/ar_SA/suppliers.lang @@ -14,7 +14,6 @@ Supplier=المورد AddSupplier=إضافة مورد SupplierRemoved=إزالة المورد SuppliersInvoice=فاتورة الموردين -SuppliersInvoices=فواتير الموردين NewSupplier=مورد جديد History=التاريخ ListOfSuppliers=قائمة الموردين diff --git a/htdocs/langs/bg_BG/suppliers.lang b/htdocs/langs/bg_BG/suppliers.lang index 283ada1c1c5..e279ad69213 100644 --- a/htdocs/langs/bg_BG/suppliers.lang +++ b/htdocs/langs/bg_BG/suppliers.lang @@ -13,7 +13,6 @@ Supplier=Снабдител AddSupplier=Добави доставчик SupplierRemoved=Изтрити доставчик SuppliersInvoice=Фактура -SuppliersInvoices=Фактури NewSupplier=Нов доставчик History=Исторически ListOfSuppliers=Списък на доставчиците diff --git a/htdocs/langs/ca_ES/admin.lang b/htdocs/langs/ca_ES/admin.lang index 06873ef9f89..c5dce9389a6 100644 --- a/htdocs/langs/ca_ES/admin.lang +++ b/htdocs/langs/ca_ES/admin.lang @@ -949,6 +949,7 @@ DocumentModelOdt=Generació des dels documents amb format OpenDocument (Arxiu .O WatermarkOnDraft=Marca d'aigua en els documents esborrany CompanyIdProfChecker=Id Professional únic MustBeUnique=Ha de ser únic? +MustBeMandatory=Ha de ser obligatori? Miscellanous=Miscel·lània ##### Webcal setup ##### WebCalSetup=Configuració d'enllaç amb el calendari webcalendar diff --git a/htdocs/langs/ca_ES/bills.lang b/htdocs/langs/ca_ES/bills.lang index f6ce99e3c04..d8d87882d13 100644 --- a/htdocs/langs/ca_ES/bills.lang +++ b/htdocs/langs/ca_ES/bills.lang @@ -47,7 +47,7 @@ InvoiceCustomer=Factura a client CustomerInvoice=Factura a client CustomersInvoices=Factures a clientes SupplierInvoice=Factura de proveïdor -SuppliersInvoices=Factures de proveïdors +SuppliersInvoices=Factures proveïdors SupplierBill=Factura de proveïdor SupplierBills=Factures de proveïdors Payment=Pagament diff --git a/htdocs/langs/ca_ES/companies.lang b/htdocs/langs/ca_ES/companies.lang index caa0cfe0174..63ae033cd98 100644 --- a/htdocs/langs/ca_ES/companies.lang +++ b/htdocs/langs/ca_ES/companies.lang @@ -108,42 +108,49 @@ ProfId2AR=Ingressos bruts ProfId3AR=- ProfId4AR=- ProfId5AR=- +ProfId6AR=- ProfId1AU=ABN ProfId2AU=- ProfId3AU=- ProfId4AU=- ProfId5AU=- +ProfId6AU=- ProfId1BE=N° col·legiat ProfId2BE=- ProfId3BE=- ProfId4BE=- ProfId5BE=- -ProfId1BR=CNPJ +ProfId6BE=- +ProfId1BR=- ProfId2BR=IE (Inscricao Estadual) ProfId3BR=IM (Inscricao Municipal) ProfId4BR=CPF -#ProfId5BR=CNAE= -#ProfId6BR=INSS= +#ProfId5BR=CNAE +#ProfId6BR=INSS ProfId1CH=- ProfId2CH=- ProfId3CH=Número federat ProfId4CH=Num registre de comerç ProfId5CH=- +ProfId6CH=- ProfId1CL=R.U.T. ProfId2CL=- ProfId3CL=- ProfId4CL=- ProfId5CL=- +ProfId6CL=- ProfId1CO=R.U.T. ProfId2CO=- ProfId3CO=- ProfId4CO=- ProfId5CO=- +ProfId6CO=- ProfId1DE=Id prof. 1 (USt.-IdNr) ProfId2DE=Id prof. 2 (USt.-Nr) ProfId3DE=Id prof. 3 (Handelsregister-Nr.) ProfId4DE=- ProfId5DE=- +ProfId6DE=- ProfId1ES=CIF/NIF ProfId2ES=Núm seguretat social ProfId3ES=CNAE @@ -161,51 +168,61 @@ ProfId2GB=- ProfId3GB=SIC ProfId4GB=- ProfId5GB=- +ProfId6GB=- ProfId1HN=RTN ProfId2HN=- ProfId3HN=- ProfId4HN=- ProfId5HN=- +ProfId6HN=- ProfId1IN=Id prof. 1 (TIN) -ProfId2IN=Id prof. 2 -ProfId3IN=Id prof. 3 +ProfId2IN=Id prof. 2 (PAN) +ProfId3IN=Id prof. 3 (SRVC TAX) ProfId4IN=Id prof. 4 ProfId5IN=Id prof. 5 +ProfId6IN=- ProfId1MA=Id prof. 1 (R.C.) ProfId2MA=Id prof. 2 (Patente) ProfId3MA=Id prof. 3 (I.F.) ProfId4MA=Id prof. 4 (C.N.S.S.) ProfId5MA=- +ProfId6MA=- ProfId1MX=R.F.C. ProfId2MX=Registre Patronal IMSS ProfId3MX=Cèdula Professional ProfId4MX=- ProfId5MX=- +ProfId6MX=- ProfId1NL=Número KVK ProfId2NL=- ProfId3NL=- ProfId4NL=- ProfId5NL=- +ProfId6NL=- ProfId1PT=NIPC ProfId2PT=Núm seguretat social ProfId3PT=Num reg. comercial ProfId4PT=Conservatori ProfId5PT=- +ProfId6PT=- ProfId1RU=OGRN ProfId2RU=INN ProfId3RU=KPP ProfId4RU=OKPO ProfId5RU=- +ProfId6RU=- ProfId1SN=RC ProfId2SN=NINEA ProfId3SN=- ProfId4SN=- ProfId5SN=- +ProfId6SN=- ProfId1TN=RC ProfId2TN=Matrícula fiscal ProfId3TN=Codi en aduana ProfId4TN=CCC ProfId5TN=- +ProfId6TN=- VATIntra=NIF intracomunitari VATIntraShort=NIF intra. VATIntraVeryShort=NIF intra. diff --git a/htdocs/langs/ca_ES/errors.lang b/htdocs/langs/ca_ES/errors.lang index fd43de81c10..ec04e3ff9ce 100644 --- a/htdocs/langs/ca_ES/errors.lang +++ b/htdocs/langs/ca_ES/errors.lang @@ -21,6 +21,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Aquest contacte ja està definit com ErrorCashAccountAcceptsOnlyCashMoney=Aquesta compte bancari és de tipus caixa i només accepta el mètode de pagament de tipus espècie. ErrorFromToAccountsMustDiffers=El compte origen i destinació han de ser diferents. ErrorBadThirdPartyName=Nom de tercer incorrecte +ErrorProdIdIsMandatory=El %s es obligatori ErrorBadCustomerCodeSyntax=La sintaxi del codi client és incorrecta ErrorCustomerCodeRequired=Codi client obligatori ErrorCustomerCodeAlreadyUsed=Codi de client ja utilitzat diff --git a/htdocs/langs/ca_ES/margins.lang b/htdocs/langs/ca_ES/margins.lang index f502a3274bf..62bb253a587 100644 --- a/htdocs/langs/ca_ES/margins.lang +++ b/htdocs/langs/ca_ES/margins.lang @@ -46,4 +46,8 @@ MargeNette=Marge net MARGIN_TYPE_DETAILS=Marge brut: Preu de venda sense IVA - Preu de compra sense IVA
Marge net: Preu de venda sense IVA - Costos BuyingCost=Costos -UnitCharges=Càrrega unitària \ No newline at end of file +UnitCharges=Càrrega unitària +Charges=Càrreges + +AgentContactType=Tipus de contacte comissionat +AgentContactTypeDetails=Indica el tipus de contacte enllaçat a les factures que seran associats als agents comercials \ No newline at end of file diff --git a/htdocs/langs/ca_ES/products.lang b/htdocs/langs/ca_ES/products.lang index f1c0fbb0616..71d8d426d2c 100644 --- a/htdocs/langs/ca_ES/products.lang +++ b/htdocs/langs/ca_ES/products.lang @@ -146,6 +146,8 @@ ProductSpecial=Especial QtyMin=Quantitat mínima PriceQty=Preu per la quantitat PriceQtyMin=Preu quantitat min. +DiscountQtyMin=Descompte per defecte quantitat min. +VATRateForSupplierProduct=Taxa IVA (per aquest producte/proveïdor) NoPriceDefinedForThisSupplier=Cap preu/quant. definit per a aquest proveïdor/producte NoSupplierPriceDefinedForThisProduct=Cap preu/quant. proveïdor definit per a aquest producte RecordedProducts=Productes en venda diff --git a/htdocs/langs/ca_ES/suppliers.lang b/htdocs/langs/ca_ES/suppliers.lang index be740e4eab1..065d0404862 100644 --- a/htdocs/langs/ca_ES/suppliers.lang +++ b/htdocs/langs/ca_ES/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Proveïdor AddSupplier=Afegir proveïdor SupplierRemoved=Proveïdor eliminat SuppliersInvoice=Factura proveïdor -SuppliersInvoices=Factures proveïdors NewSupplier=Nou proveïdor History=Històric ListOfSuppliers=Llistat de proveïdors diff --git a/htdocs/langs/da_DK/suppliers.lang b/htdocs/langs/da_DK/suppliers.lang index cc435074e79..5b06a4bfdba 100644 --- a/htdocs/langs/da_DK/suppliers.lang +++ b/htdocs/langs/da_DK/suppliers.lang @@ -16,7 +16,6 @@ Supplier=Leverandør AddSupplier=Tilføj en leverandør SupplierRemoved=Leverandør fjernet SuppliersInvoice=Leverandører faktura -SuppliersInvoices=Leverandører fakturaer NewSupplier=Ny leverandør History=Historie ListOfSuppliers=Liste over leverandører diff --git a/htdocs/langs/de_AT/suppliers.lang b/htdocs/langs/de_AT/suppliers.lang index 6a960705d76..5d17837ec06 100644 --- a/htdocs/langs/de_AT/suppliers.lang +++ b/htdocs/langs/de_AT/suppliers.lang @@ -12,7 +12,6 @@ Supplier=Lieferant AddSupplier=Lieferanten hinzufügen SupplierRemoved=Lieferant entfernt SuppliersInvoice=Lieferantenrechnung -SuppliersInvoices=Lieferantenrechnungen NewSupplier=Neuer Lieferant History=Verlauf ListOfSuppliers=Lieferantenliste diff --git a/htdocs/langs/de_DE/suppliers.lang b/htdocs/langs/de_DE/suppliers.lang index 945bea65fcd..e44f7ed7ccb 100644 --- a/htdocs/langs/de_DE/suppliers.lang +++ b/htdocs/langs/de_DE/suppliers.lang @@ -12,7 +12,6 @@ Supplier=Lieferant AddSupplier=Lieferanten hinzufügen SupplierRemoved=Lieferant entfernt SuppliersInvoice=Lieferantenrechnung -SuppliersInvoices=Lieferantenrechnungen NewSupplier=Neuer Lieferant History=Verlauf ListOfSuppliers=Lieferantenliste diff --git a/htdocs/langs/el_GR/suppliers.lang b/htdocs/langs/el_GR/suppliers.lang index 5a42434f340..9db72404188 100644 --- a/htdocs/langs/el_GR/suppliers.lang +++ b/htdocs/langs/el_GR/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Προμηθευτής AddSupplier=Προσθήκη προμηθευτή SupplierRemoved=Ο προμηθευτής αφαιρέθηκε SuppliersInvoice=Τιμολόγιο προμηθευτή -SuppliersInvoices=Τιμολόγια προμηθευτών NewSupplier=Νέος προμηθευτής History=Ιστορικό ListOfSuppliers=Λίστα προμηθευτών diff --git a/htdocs/langs/en_SA/main.lang b/htdocs/langs/en_SA/main.lang new file mode 100644 index 00000000000..5ae5fd3a44e --- /dev/null +++ b/htdocs/langs/en_SA/main.lang @@ -0,0 +1,17 @@ +# Dolibarr language file - en_WW - main +CHARSET=UTF-8 +DIRECTION=ltr +FONTFORPDF=DejaVuSans +FONTSIZEFORPDF=9 +SeparatorDecimal=. +SeparatorThousand=, +FormatDateShort=%d/%m/%Y +FormatDateShortJava=dd/MM/yyyy +FormatDateShortJQuery=dd/mm/yy +FormatHourShort=%I:%M %p +FormatHourShortDuration=%H:%M +FormatDateTextShort=%b %d, %Y +FormatDateText=%B %d, %Y +FormatDateHourShort=%d/%m/%Y %I:%M %p +FormatDateHourTextShort=%b %d, %Y, %I:%M %p +FormatDateHourText=%B %d, %Y, %I:%M %p \ No newline at end of file diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 6a50d4b087a..b07c69d7259 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -939,6 +939,7 @@ DocumentModelOdt=Generate documents from OpenDocuments templates (.ODT files for WatermarkOnDraft=Watermark on draft document CompanyIdProfChecker=Professional Id unique MustBeUnique=Must be unique ? +MustBeMandatory=Must be mandatory ? Miscellanous=Miscellaneous ##### Webcal setup ##### WebCalSetup=Webcalendar link setup diff --git a/htdocs/langs/en_US/bills.lang b/htdocs/langs/en_US/bills.lang index 6195a5147b9..01cbb6950d4 100644 --- a/htdocs/langs/en_US/bills.lang +++ b/htdocs/langs/en_US/bills.lang @@ -49,9 +49,9 @@ Invoices=Invoices InvoiceLine=Invoice line InvoiceCustomer=Customer invoice CustomerInvoice=Customer invoice -CustomersInvoices=Customer's invoices +CustomersInvoices=Customers invoices SupplierInvoice=Supplier invoice -SuppliersInvoices=Supplier's invoices +SuppliersInvoices=Suppliers invoices SupplierBill=Supplier invoice SupplierBills=suppliers invoices Payment=Payment diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 19a36f64c22..f2f537453e7 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -25,6 +25,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=This contact is already defined as co ErrorCashAccountAcceptsOnlyCashMoney=This bank account is a cash account, so it accepts payments of type cash only. ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be different. ErrorBadThirdPartyName=Bad value for third party name +ErrorProdIdIsMandatory=The %s is mandatory ErrorBadCustomerCodeSyntax=Bad syntax for customer code ErrorCustomerCodeRequired=Customer code required ErrorCustomerCodeAlreadyUsed=Customer code already used diff --git a/htdocs/langs/en_US/languages.lang b/htdocs/langs/en_US/languages.lang index e2f8cd0a510..8f79cd99fe0 100644 --- a/htdocs/langs/en_US/languages.lang +++ b/htdocs/langs/en_US/languages.lang @@ -14,6 +14,7 @@ Language_en_AU=English (Australia) Language_en_GB=English (United Kingdom) Language_en_IN=English (India) Language_en_NZ=English (New Zealand) +Language_en_SA=English (Saudi Arabia) Language_en_US=English (United States) Language_es_ES=Spanish Language_es_AR=Spanish (Argentina) diff --git a/htdocs/langs/en_US/margins.lang b/htdocs/langs/en_US/margins.lang index 41203847ba5..10a8112f87e 100644 --- a/htdocs/langs/en_US/margins.lang +++ b/htdocs/langs/en_US/margins.lang @@ -47,6 +47,7 @@ MARGIN_TYPE_DETAILS=Raw margin : Selling price - Buying price
Net margin : S BuyingCost=Cost price UnitCharges=Unit charges +Charges=Charges AgentContactType=Contact type used for commissioning AgentContactTypeDetails=Défine what contact type (linked on invoices) will be associated with commercial agents \ No newline at end of file diff --git a/htdocs/langs/en_US/suppliers.lang b/htdocs/langs/en_US/suppliers.lang index fd5a35d3f53..8f05c209b95 100644 --- a/htdocs/langs/en_US/suppliers.lang +++ b/htdocs/langs/en_US/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Supplier AddSupplier=Add a supplier SupplierRemoved=Supplier removed SuppliersInvoice=Suppliers invoice -SuppliersInvoices=Suppliers invoices NewSupplier=New supplier History=History ListOfSuppliers=List of suppliers diff --git a/htdocs/langs/es_ES/admin.lang b/htdocs/langs/es_ES/admin.lang index d5a9df404a9..3a43d9c67b3 100644 --- a/htdocs/langs/es_ES/admin.lang +++ b/htdocs/langs/es_ES/admin.lang @@ -952,6 +952,7 @@ DocumentModelOdt=Generación desde los documentos OpenDocument (Archivo .ODT Ope WatermarkOnDraft=Marca de agua en los documentos borrador CompanyIdProfChecker=Id Profesional único MustBeUnique=¿Debe ser único? +MustBeMandatory=¿Debe ser obligatorio? Miscellanous=Miscelánea ##### Webcal setup ##### WebCalSetup=Configuración de enlace con el calendario Webcalendar diff --git a/htdocs/langs/es_ES/bills.lang b/htdocs/langs/es_ES/bills.lang index 63a33d062b0..42e5f4c60ba 100644 --- a/htdocs/langs/es_ES/bills.lang +++ b/htdocs/langs/es_ES/bills.lang @@ -47,7 +47,7 @@ InvoiceCustomer=Factura a cliente CustomerInvoice=Factura a cliente CustomersInvoices=Facturas a clientes SupplierInvoice=Factura de proveedor -SuppliersInvoices=Facturas de proveedores +SuppliersInvoices=Facturas proveedores SupplierBill=Factura de proveedor SupplierBills=Facturas de proveedores Payment=Pago diff --git a/htdocs/langs/es_ES/companies.lang b/htdocs/langs/es_ES/companies.lang index 9313df97434..511921a014b 100644 --- a/htdocs/langs/es_ES/companies.lang +++ b/htdocs/langs/es_ES/companies.lang @@ -109,17 +109,20 @@ ProfId2AR=Ingresos brutos ProfId3AR=- ProfId4AR=- ProfId5AR=- +ProfId6AR=- ProfId1AU=ABN ProfId2AU=- ProfId3AU=- ProfId4AU=- ProfId5AU=- +ProfId6AU=- ProfId1BE=N° colegiado ProfId2BE=- ProfId3BE=- ProfId4BE=- ProfId5BE=- -ProfId1BR=CNPJ +ProfId6BE=- +ProfId1BR=- ProfId2BR=IE (Inscricao Estadual) ProfId3BR=IM (Inscricao Municipal) ProfId4BR=CPF @@ -130,21 +133,25 @@ ProfId2CH=- ProfId3CH=Número federado ProfId4CH=Num registro de comercio ProfId5CH=- +ProfId6CH=- ProfId1CL=R.U.T. ProfId2CL=- ProfId3CL=- ProfId4CL=- ProfId5CL=- +ProfId6CL=- ProfId1CO=R.U.T. ProfId2CO=- ProfId3CO=- ProfId4CO=- ProfId5CO=- +ProfId6CO=- ProfId1DE=Id prof. 1 (USt.-IdNr) ProfId2DE=Id prof. 2 (USt.-Nr) ProfId3DE=Id prof. 3 (Handelsregister-Nr.) ProfId4DE=- ProfId5DE=- +ProfId6DE=- ProfId1ES=CIF/NIF ProfId2ES=Núm seguridad social ProfId3ES=CNAE @@ -162,51 +169,61 @@ ProfId2GB=- ProfId3GB=SIC ProfId4GB=- ProfId5GB=- +ProfId6GB=- ProfId1HN=RTN ProfId2HN=- ProfId3HN=- ProfId4HN=- ProfId5HN=- +ProfId6HN=- ProfId1IN=Id prof. 1 (TIN) ProfId2IN=Id prof. 2 ProfId3IN=Id prof. 3 ProfId4IN=Id prof. 4 ProfId5IN=Id prof. 5 +ProfId6IN=- ProfId1MA=Id prof. 1 (R.C.) ProfId2MA=Id prof. 2 (Patente) ProfId3MA=Id prof. 3 (I.F.) ProfId4MA=Id prof. 4 (C.N.S.S.) -ProfId5MA=Id prof. 5 +ProfId5MA=- +ProfId6MA=- ProfId1MX=R.F.C. ProfId2MX=Registro Patronal IMSS ProfId3MX=Cédula Profesional ProfId4MX=- ProfId5MX=- +ProfId6MX=- ProfId1NL=Número KVK ProfId2NL=- ProfId3NL=- ProfId4NL=- ProfId5NL=- +ProfId6NL=- ProfId1PT=NIPC ProfId2PT=Núm. seguridad social ProfId3PT=Num reg. comercial ProfId4PT=Conservatorio ProfId5PT=- +ProfId6PT=- ProfId1RU=OGRN ProfId2RU=INN ProfId3RU=KPP ProfId4RU=OKPO ProfId5RU=- +ProfId6RU=- ProfId1SN=RC ProfId2SN=NINEA ProfId3SN=- ProfId4SN=- ProfId5SN=- +ProfId6SN=- ProfId1TN=RC ProfId2TN=Matrícula fiscal ProfId3TN=Código en aduana ProfId4TN=CCC ProfId5TN=- +ProfId6TN=- VATIntra=NIF intracomunitario VATIntraShort=NIF intra. VATIntraVeryShort=NIF intra. diff --git a/htdocs/langs/es_ES/errors.lang b/htdocs/langs/es_ES/errors.lang index 580627e6cab..d723910a5bd 100644 --- a/htdocs/langs/es_ES/errors.lang +++ b/htdocs/langs/es_ES/errors.lang @@ -21,6 +21,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Este contacto ya está definido como ErrorCashAccountAcceptsOnlyCashMoney=Esta cuenta bancaria es de tipo caja y solo acepta el método de pago de tipo especie. ErrorFromToAccountsMustDiffers=La cuenta origen y destino deben ser diferentes. ErrorBadThirdPartyName=Nombre de tercero incorrecto +ErrorProdIdIsMandatory=El %s es obligatorio ErrorBadCustomerCodeSyntax=La sintaxis del código cliente es incorrecta ErrorCustomerCodeRequired=Código cliente obligatorio ErrorCustomerCodeAlreadyUsed=Código de cliente ya utilizado diff --git a/htdocs/langs/es_ES/margins.lang b/htdocs/langs/es_ES/margins.lang index 5ff7b74b7d4..0dc08481c46 100644 --- a/htdocs/langs/es_ES/margins.lang +++ b/htdocs/langs/es_ES/margins.lang @@ -46,4 +46,8 @@ MargeNette=Margen neto MARGIN_TYPE_DETAILS=Margen bruto : Precio de venta sin IVA - Precio de compra sin IVA
Margen neto : Precio de venta sin IVA - Costos BuyingCost=Costos -UnitCharges=Carga unitaria \ No newline at end of file +UnitCharges=Carga unitaria +Charges=Cargas + +AgentContactType=Tipo de contacto comisionado +AgentContactTypeDetails=Indica el tipo de contacto enlazado a las facturas que serán asociados a los agentes comerciales \ No newline at end of file diff --git a/htdocs/langs/es_ES/products.lang b/htdocs/langs/es_ES/products.lang index 97d4586bae6..a3c2bf41eb7 100644 --- a/htdocs/langs/es_ES/products.lang +++ b/htdocs/langs/es_ES/products.lang @@ -146,6 +146,8 @@ ProductSpecial=Especial QtyMin=Cantidad mínima PriceQty=Precio para la cantidad PriceQtyMin=Precio cantidad mín. +DiscountQtyMin=Descuento por defecto cantidad mín. +VATRateForSupplierProduct=Tasa IVA (para este producto/proveedor) NoPriceDefinedForThisSupplier=Ningún precio/cant. definido para este proveedor/producto NoSupplierPriceDefinedForThisProduct=Ningún precio/cant. proveedor definida para este producto RecordedProducts=Productos en venta diff --git a/htdocs/langs/es_ES/suppliers.lang b/htdocs/langs/es_ES/suppliers.lang index a03eccb719f..e500aea17bb 100644 --- a/htdocs/langs/es_ES/suppliers.lang +++ b/htdocs/langs/es_ES/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Proveedor AddSupplier=Añadir proveedor SupplierRemoved=Proveedor eliminado SuppliersInvoice=Factura proveedor -SuppliersInvoices=Facturas proveedores NewSupplier=Nuevo proveedor History=Histórico ListOfSuppliers=Listado de proveedores diff --git a/htdocs/langs/et_EE/suppliers.lang b/htdocs/langs/et_EE/suppliers.lang index 57f6ab11194..c9487dad634 100644 --- a/htdocs/langs/et_EE/suppliers.lang +++ b/htdocs/langs/et_EE/suppliers.lang @@ -13,7 +13,6 @@ Supplier=Tarnija AddSupplier=Lisa tarnija SupplierRemoved=Tarnija välja SuppliersInvoice=Tarnijate arve -SuppliersInvoices=Tarnijate arvete NewSupplier=New tarnija History=Ajalugu ListOfSuppliers=Tarnijate diff --git a/htdocs/langs/fa_IR/suppliers.lang b/htdocs/langs/fa_IR/suppliers.lang index 327d6ecc56e..d24ea173e77 100644 --- a/htdocs/langs/fa_IR/suppliers.lang +++ b/htdocs/langs/fa_IR/suppliers.lang @@ -14,7 +14,6 @@ Supplier=المورد AddSupplier=إضافة مورد SupplierRemoved=إزالة المورد SuppliersInvoice=فاتورة الموردين -SuppliersInvoices=فواتير الموردين NewSupplier=مورد جديد History=التاريخ ListOfSuppliers=قائمة الموردين diff --git a/htdocs/langs/fi_FI/suppliers.lang b/htdocs/langs/fi_FI/suppliers.lang index 8d8d8e5fb0d..43e75c7d246 100644 --- a/htdocs/langs/fi_FI/suppliers.lang +++ b/htdocs/langs/fi_FI/suppliers.lang @@ -14,7 +14,6 @@ Supplier=Toimittaja AddSupplier=Lisää toimittaja SupplierRemoved=Toimittaja poistettu SuppliersInvoice=Tavarantoimittajat lasku -SuppliersInvoices=Tavarantoimittajat laskut NewSupplier=Uuden toimittajan History=Historia ListOfSuppliers=Luettelo toimittajat diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 6afab6c47ab..000a58860f9 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -946,6 +946,7 @@ DocumentModelOdt=Genération depuis des modèles OpenDocument (Fichier .ODT Open WatermarkOnDraft=Filigrane sur les documents brouillons CompanyIdProfChecker=Id professionel unique MustBeUnique=Doit être unique ? +MustBeMandatory=Doit être obligatoire? Miscellanous=Divers ##### Webcal setup ##### WebCalSetup= Configuration du lien vers le calendrier Webcalendar diff --git a/htdocs/langs/fr_FR/bills.lang b/htdocs/langs/fr_FR/bills.lang index 866773ee131..30786b6e542 100644 --- a/htdocs/langs/fr_FR/bills.lang +++ b/htdocs/langs/fr_FR/bills.lang @@ -47,7 +47,6 @@ InvoiceCustomer=Facture client CustomerInvoice=Facture client CustomersInvoices=Factures clients SupplierInvoice=Facture fournisseur -SuppliersInvoices=Factures fournisseurs SupplierBill=Facture fournisseur SupplierBills=Factures fournisseurs Payment=Règlement diff --git a/htdocs/langs/fr_FR/errors.lang b/htdocs/langs/fr_FR/errors.lang index 87715bea1fe..b6fcbb6611b 100644 --- a/htdocs/langs/fr_FR/errors.lang +++ b/htdocs/langs/fr_FR/errors.lang @@ -26,6 +26,7 @@ ErrorThisContactIsAlreadyDefinedAsThisType=Ce contact est déjà défini comme c ErrorCashAccountAcceptsOnlyCashMoney=Ce compte bancaire est de type caisse et n'accepte que les mode de règlement de type espèce. ErrorFromToAccountsMustDiffers=Le compte source et destination doivent être différents. ErrorBadThirdPartyName=Nom de tiers incorrect +ErrorProdIdIsMandatory=Le %s est obligatoire ErrorBadCustomerCodeSyntax=La syntaxe du code client est incorrecte ErrorCustomerCodeRequired=Code client obligatoire ErrorCustomerCodeAlreadyUsed=Code client déjà utilisé diff --git a/htdocs/langs/fr_FR/languages.lang b/htdocs/langs/fr_FR/languages.lang index 09231867347..40efc72e533 100644 --- a/htdocs/langs/fr_FR/languages.lang +++ b/htdocs/langs/fr_FR/languages.lang @@ -14,6 +14,7 @@ Language_en_AU=Anglais (Australie) Language_en_GB=Anglais (Royaume-Uni) Language_en_IN=Anglais (Inde) Language_en_NZ=Anglais (Nouvelle Zeland) +Language_en_SA=Anglais (Arabie Saoudite) Language_en_US=Anglais (Etats-Unis) Language_es_ES=Espagnol Language_es_AR=Espagnol (Argentine) diff --git a/htdocs/langs/fr_FR/margins.lang b/htdocs/langs/fr_FR/margins.lang index 02dfedbbe9a..3c81a9a1e4d 100644 --- a/htdocs/langs/fr_FR/margins.lang +++ b/htdocs/langs/fr_FR/margins.lang @@ -47,6 +47,7 @@ MARGIN_TYPE_DETAILS=Marge brute : Prix de vente HT - Prix d'achat HT
Marge n BuyingCost=Coût de revient UnitCharges=Charge unitaire +Charges=Charges AgentContactType=Type de contact commissionné AgentContactTypeDetails=Permet de définir le type de contact associé aux factures qui sera associé aux agents commerciaux \ No newline at end of file diff --git a/htdocs/langs/fr_FR/suppliers.lang b/htdocs/langs/fr_FR/suppliers.lang index c042b74ea89..932615ff181 100644 --- a/htdocs/langs/fr_FR/suppliers.lang +++ b/htdocs/langs/fr_FR/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Fournisseur AddSupplier=Ajouter un fournisseur SupplierRemoved=Fournisseur supprimé SuppliersInvoice=Facture fournisseur -SuppliersInvoices=Factures fournisseurs NewSupplier=Nouveau fournisseur History=Historique ListOfSuppliers=Liste des fournisseurs diff --git a/htdocs/langs/he_IL/suppliers.lang b/htdocs/langs/he_IL/suppliers.lang index 0949262da42..3706da71c41 100644 --- a/htdocs/langs/he_IL/suppliers.lang +++ b/htdocs/langs/he_IL/suppliers.lang @@ -13,7 +13,6 @@ Supplier=ספק AddSupplier=הוסף הספק SupplierRemoved=הספק הוסר SuppliersInvoice=ספקים חשבונית -SuppliersInvoices=חשבוניות ספקים NewSupplier=חדש הספק History=היסטוריה ListOfSuppliers=רשימת הספקים diff --git a/htdocs/langs/hu_HU/suppliers.lang b/htdocs/langs/hu_HU/suppliers.lang index 9a0c2643fc7..89bdd570292 100644 --- a/htdocs/langs/hu_HU/suppliers.lang +++ b/htdocs/langs/hu_HU/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Beszállító AddSupplier=Beszállító hozzáadása SupplierRemoved=Beszállító eltávolítva SuppliersInvoice=Beszállító számla -SuppliersInvoices=Beszállítók számlái NewSupplier=Új beszállító History=Történet ListOfSuppliers=Beszállító listája diff --git a/htdocs/langs/is_IS/suppliers.lang b/htdocs/langs/is_IS/suppliers.lang index 625ded3432e..a33597212b3 100644 --- a/htdocs/langs/is_IS/suppliers.lang +++ b/htdocs/langs/is_IS/suppliers.lang @@ -13,7 +13,6 @@ Supplier=Birgir AddSupplier=Bæta við birgja SupplierRemoved=Birgir fjarri SuppliersInvoice=Birgjar Reikningar -SuppliersInvoices=Birgjar reikningum NewSupplier=New birgir History=Saga ListOfSuppliers=Listi yfir birgja diff --git a/htdocs/langs/it_IT/suppliers.lang b/htdocs/langs/it_IT/suppliers.lang index 7f21a0f73c3..8771326292b 100644 --- a/htdocs/langs/it_IT/suppliers.lang +++ b/htdocs/langs/it_IT/suppliers.lang @@ -39,4 +39,3 @@ SupplierRemoved =Fornitore rimosso SuppliersArea =Area fornitori Suppliers =Fornitori SuppliersInvoice =Fattura Fornitore -SuppliersInvoices =Fatture fornitori diff --git a/htdocs/langs/ja_JP/suppliers.lang b/htdocs/langs/ja_JP/suppliers.lang index 3cb36fb8a85..70416c864a9 100644 --- a/htdocs/langs/ja_JP/suppliers.lang +++ b/htdocs/langs/ja_JP/suppliers.lang @@ -13,7 +13,6 @@ Supplier=サプライヤー AddSupplier=サプライヤーを追加します。 SupplierRemoved=サプライヤーは、削除 SuppliersInvoice=仕入先の請求書 -SuppliersInvoices=仕入先の請求書 NewSupplier=新しいサプライヤー History=歴史 ListOfSuppliers=サプライヤーのリスト diff --git a/htdocs/langs/nb_NO/suppliers.lang b/htdocs/langs/nb_NO/suppliers.lang index 120b83656a5..9ee3898c986 100644 --- a/htdocs/langs/nb_NO/suppliers.lang +++ b/htdocs/langs/nb_NO/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Leverandør AddSupplier=Legg til en leverandør SupplierRemoved=Leverandør slettet SuppliersInvoice=Leverandørfaktura -SuppliersInvoices=Leverandørfakturaer NewSupplier=Ny leverandør History=Historikk ListOfSuppliers=Leverandøroversikt diff --git a/htdocs/langs/nl_BE/suppliers.lang b/htdocs/langs/nl_BE/suppliers.lang index 2c3a226584f..5326e9b7fe5 100644 --- a/htdocs/langs/nl_BE/suppliers.lang +++ b/htdocs/langs/nl_BE/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Leverancier AddSupplier=Voeg een leverancier toe SupplierRemoved=Leverancier verwijderd SuppliersInvoice=Leveranciers factuur -SuppliersInvoices=Leveranciers facturen NewSupplier=Nieuwe leverancier History=Geschiedenis ListOfSuppliers=Lijst van de leveranciers diff --git a/htdocs/langs/nl_NL/suppliers.lang b/htdocs/langs/nl_NL/suppliers.lang index 6d43ab7831b..1d8f1a032d8 100644 --- a/htdocs/langs/nl_NL/suppliers.lang +++ b/htdocs/langs/nl_NL/suppliers.lang @@ -5,7 +5,6 @@ Supplier = Leverancier AddSupplier = Voeg een leverancier toe SupplierRemoved = Leverancier verwijderd SuppliersInvoice = Leveranciersfactuur -SuppliersInvoices = Leveranciersfacturen NewSupplier = Nieuwe leverancier History = Geschiedenis ListOfSuppliers = Leverancierslijst diff --git a/htdocs/langs/pl_PL/suppliers.lang b/htdocs/langs/pl_PL/suppliers.lang index 88c424f5ab0..ce47c187730 100644 --- a/htdocs/langs/pl_PL/suppliers.lang +++ b/htdocs/langs/pl_PL/suppliers.lang @@ -16,7 +16,6 @@ Supplier=Dostawca AddSupplier=Dodaj dostawcy SupplierRemoved=Dostawca usunięte SuppliersInvoice=Dostawcy faktury -SuppliersInvoices=Dostawcy faktur NewSupplier=Nowy dostawca History=Historia ListOfSuppliers=Lista dostawców diff --git a/htdocs/langs/pt_BR/suppliers.lang b/htdocs/langs/pt_BR/suppliers.lang index acc5ad3d5e6..537a39c03f8 100644 --- a/htdocs/langs/pt_BR/suppliers.lang +++ b/htdocs/langs/pt_BR/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Fornecedor AddSupplier=Adicionar Fornecedor SupplierRemoved=Fornecedor Eliminado SuppliersInvoice=Faturas do Fornecedor -SuppliersInvoices=Faturas de Fornecedores NewSupplier=Novo Fornecedor History=Histórico ListOfSuppliers=Lista de Fornecedores diff --git a/htdocs/langs/pt_PT/suppliers.lang b/htdocs/langs/pt_PT/suppliers.lang index faab981a749..85dfde74227 100644 --- a/htdocs/langs/pt_PT/suppliers.lang +++ b/htdocs/langs/pt_PT/suppliers.lang @@ -5,7 +5,6 @@ Supplier=Fornecedor AddSupplier=Adicionar Fornecedor SupplierRemoved=Fornecedor Eliminado SuppliersInvoice=Facturas do Fornecedor -SuppliersInvoices=Facturas de Fornecedores NewSupplier=Novo Fornecedor History=Histórico ListOfSuppliers=Lista de Fornecedores diff --git a/htdocs/langs/ro_RO/suppliers.lang b/htdocs/langs/ro_RO/suppliers.lang index 9603ceaeb1d..e1a10dc72be 100644 --- a/htdocs/langs/ro_RO/suppliers.lang +++ b/htdocs/langs/ro_RO/suppliers.lang @@ -14,7 +14,6 @@ Supplier=Furnizor AddSupplier=Adauga un furnizor SupplierRemoved=Furnizor eliminat SuppliersInvoice=Furnizori de factură -SuppliersInvoices=Furnizori facturi NewSupplier=New furnizor History=Istorie ListOfSuppliers=Lista de furnizori diff --git a/htdocs/langs/ru_RU/suppliers.lang b/htdocs/langs/ru_RU/suppliers.lang index 252c838ad1e..c118f0af1a9 100644 --- a/htdocs/langs/ru_RU/suppliers.lang +++ b/htdocs/langs/ru_RU/suppliers.lang @@ -14,7 +14,6 @@ Supplier=Поставщик AddSupplier=Добавить поставщиком SupplierRemoved=Поставщик удален SuppliersInvoice=Поставщики счета -SuppliersInvoices=Поставщики счета NewSupplier=Новый поставщик History=История ListOfSuppliers=Список поставщиков diff --git a/htdocs/langs/sl_SI/suppliers.lang b/htdocs/langs/sl_SI/suppliers.lang index 42e73cd433e..4df1bc83641 100644 --- a/htdocs/langs/sl_SI/suppliers.lang +++ b/htdocs/langs/sl_SI/suppliers.lang @@ -5,7 +5,6 @@ Supplier = Dobavitelj AddSupplier = Dodaj dobavitelja SupplierRemoved = Dobavitelj odstranjen SuppliersInvoice = Računi dobavitelja -SuppliersInvoices = Računi dobaviteljev NewSupplier = Nov dobavitelj History = Zgodovina ListOfSuppliers = Seznam dobaviteljev diff --git a/htdocs/langs/sv_SE/suppliers.lang b/htdocs/langs/sv_SE/suppliers.lang index 159fff54da5..3d99a40f5fe 100644 --- a/htdocs/langs/sv_SE/suppliers.lang +++ b/htdocs/langs/sv_SE/suppliers.lang @@ -13,7 +13,6 @@ Supplier=Leverantör AddSupplier=Lägg till en leverantör SupplierRemoved=Leverantör bort SuppliersInvoice=Leverantörer faktura -SuppliersInvoices=Leverantörer fakturor NewSupplier=Ny leverantör History=Historia ListOfSuppliers=Lista över leverantörer diff --git a/htdocs/langs/tr_TR/suppliers.lang b/htdocs/langs/tr_TR/suppliers.lang index f9543986615..fb3f2aa2945 100644 --- a/htdocs/langs/tr_TR/suppliers.lang +++ b/htdocs/langs/tr_TR/suppliers.lang @@ -12,7 +12,6 @@ Supplier=Tedarikçi AddSupplier=Bir tedarikçi ekle SupplierRemoved=Tedarikçi kaldırıldı SuppliersInvoice=Tedarikçi faturası -SuppliersInvoices=Tedarikçi faturaları NewSupplier=Yeni tedarikçi History=Geçmiş ListOfSuppliers=Tedarikçiler listesi diff --git a/htdocs/langs/zh_CN/suppliers.lang b/htdocs/langs/zh_CN/suppliers.lang index be4673ed4e4..49769de806b 100644 --- a/htdocs/langs/zh_CN/suppliers.lang +++ b/htdocs/langs/zh_CN/suppliers.lang @@ -13,7 +13,6 @@ Supplier=供应商 AddSupplier=新增供应商 SupplierRemoved=供应商删除 SuppliersInvoice=供应商发票 -SuppliersInvoices=供应商发票 NewSupplier=新供应商 History=历史 ListOfSuppliers=供应商名单 diff --git a/htdocs/langs/zh_TW/suppliers.lang b/htdocs/langs/zh_TW/suppliers.lang index 8a3e4b5ee2f..24bb921b63c 100644 --- a/htdocs/langs/zh_TW/suppliers.lang +++ b/htdocs/langs/zh_TW/suppliers.lang @@ -13,7 +13,6 @@ Supplier=供應商 AddSupplier=新增供應商 SupplierRemoved=供應商刪除 SuppliersInvoice=供應商的發票 -SuppliersInvoices=供應商的發票 NewSupplier=新供應商 History=歷史 ListOfSuppliers=供應商名單 diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index ce68665cb69..443b0bc4be4 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -1380,7 +1380,7 @@ print "\n
\n"; * All the "Add to" areas */ -if ($id && ($action == '' || $action == 'view') && $object->status) +if ($object->id && ($action == '' || $action == 'view') && $object->status) { print ''; diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php index 4f631358c9f..380fb625b21 100644 --- a/htdocs/product/fournisseurs.php +++ b/htdocs/product/fournisseurs.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2012 Juanjo Menent * Copyright (C) 2012 Christophe Battarel * * This program is free software; you can redistribute it and/or modify @@ -34,6 +34,8 @@ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php'; $langs->load("products"); $langs->load("suppliers"); $langs->load("bills"); +// Charges ???? +if (! empty($conf->margin->enabled)) $langs->load("margins"); $id = GETPOST('id', 'int'); $ref = GETPOST('ref', 'alpha'); diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php index b34bfb472ec..c7990224d69 100644 --- a/htdocs/product/stats/facture_fournisseur.php +++ b/htdocs/product/stats/facture_fournisseur.php @@ -165,8 +165,7 @@ if ($id > 0 || ! empty($ref)) print ""; print "\n"; - $fac=new Facture($db); - print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index bfff310636f..32ad23eafbe 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -195,6 +195,23 @@ if ($action == 'setprofid') } } +//Activate ProfId +if ($action == 'setprofidmandatory') +{ + $status = GETPOST('status','alpha'); + + $idprof="SOCIETE_IDPROF".$value."_MANDATORY"; + if (dolibarr_set_const($db, $idprof,$status,'chaine',0,'',$conf->entity) > 0) + { + header("Location: ".$_SERVER["PHP_SELF"]); + exit; + } + else + { + dol_print_error($db); + } +} + /* * View @@ -522,6 +539,7 @@ print ''; print ''; print ''; print ''; +print ''; print "\n"; $profid[0][0]=$langs->trans("ProfId1"); @@ -532,6 +550,10 @@ $profid[2][0]=$langs->trans("ProfId3"); $profid[2][1]=$langs->transcountry('ProfId3', $mysoc->country_code); $profid[3][0]=$langs->trans("ProfId4"); $profid[3][1]=$langs->transcountry('ProfId4', $mysoc->country_code); +$profid[4][0]=$langs->trans("ProfId5"); +$profid[4][1]=$langs->transcountry('ProfId5', $mysoc->country_code); +$profid[5][0]=$langs->trans("ProfId6"); +$profid[5][1]=$langs->transcountry('ProfId6', $mysoc->country_code); $var = true; $i=0; @@ -539,42 +561,47 @@ $i=0; $nbofloop=count($profid); while ($i < $nbofloop) { - $var = !$var; - - print ''; - print ''; - - switch($i) + if ($profid[$i][1]!='-') { - case 0: - $verif=(empty($conf->global->SOCIETE_IDPROF1_UNIQUE)?false:true); - break; - case 1: - $verif=(empty($conf->global->SOCIETE_IDPROF2_UNIQUE)?false:true); - break; - case 2: - $verif=(empty($conf->global->SOCIETE_IDPROF3_UNIQUE)?false:true); - break; - case 3: - $verif=(empty($conf->global->SOCIETE_IDPROF4_UNIQUE)?false:true); - break; + $var = !$var; + + print ''; + print ''; + + $idprof_unique ='SOCIETE_IDPROF'.($i+1).'_UNIQUE'; + $idprof_mandatory ='SOCIETE_IDPROF'.($i+1).'_MANDATORY'; + $verif=(empty($conf->global->$idprof_unique)?false:true); + $mandatory=(empty($conf->global->$idprof_mandatory)?false:true); + + if ($verif) + { + print ''; + } + else + { + print ''; + } + + if ($mandatory) + { + print ''; + } + else + { + print ''; + } + print "\n"; } - - if ($verif) - { - print ''; - } - else - { - print ''; - } - print "\n"; $i++; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 378cae1f8b0..9e12a508db5 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -2569,6 +2569,43 @@ class Societe extends CommonObject $this->idprof5='idprof5'; $this->idprof6='idprof6'; } + + /** + * Check if localtax define for company + * Used to build previews or test instances. + * id must be 0 if object instance is a specimen. + * + * @param localTaxNum $localTaxNum 1 or 2 + * @return boolean true / false + */ + function hasLocalTax($localTaxNum) { + global $user,$langs,$conf; + + // check parameter + if ($localTaxNum != 1 && $localTaxNum != 2) + return false; + + // Search local taxes + $sql = "SELECT t.localtax1, t.localtax2"; + $sql .= " FROM ".MAIN_DB_PREFIX."c_tva as t, ".MAIN_DB_PREFIX."c_pays as p"; + $sql .= " WHERE t.fk_pays = p.rowid AND p.code = '".$this->country_code."'"; + $sql .= " AND t.active = 1"; + if ($localTaxNum == 1) + $sql .= " AND t.localtax1 <> 0"; + elseif ($localTaxNum == 2) + $sql .= " AND t.localtax2 <> 0"; + + dol_syslog("get_localtax sql=".$sql); + $resql=$this->db->query($sql); + if ($resql) + { + return ($this->db->num_rows($resql) > 0); + + } + else + return false; + + } } diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index a916a7377c3..26c453607ec 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -5,7 +5,7 @@ * Copyright (C) 2005 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2008 Patrick Raguin - * Copyright (C) 2010-2011 Juanjo Menent + * Copyright (C) 2010-2012 Juanjo Menent * * 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 @@ -202,9 +202,18 @@ if (empty($reshook)) $error++; $errors[] = $langs->trans("ErrorSupplierModuleNotEnabled"); $action = ($action=='add'?'create':'edit'); } + + // We set country_id, country_code and country for the selected country + $object->country_id=GETPOST('country_id')?GETPOST('country_id'):$mysoc->country_id; + if ($object->country_id) + { + $tmparray=getCountry($object->country_id,'all'); + $object->country_code=$tmparray['code']; + $object->country=$tmparray['label']; + } - // Check for duplicate prof id - for ($i = 1; $i < 3; $i++) + // Check for duplicate or mandatory prof id + for ($i = 1; $i < 5; $i++) { $slabel="idprof".$i; $_POST[$slabel]=trim($_POST[$slabel]); @@ -218,8 +227,18 @@ if (empty($reshook)) $action = ($action=='add'?'create':'edit'); } } + + $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; + if (! $vallabel && ! empty($conf->global->$idprof_mandatory)) + { + $langs->load("errors"); + $error++; + $errors[] = $langs->trans("ErrorProdIdIsMandatory", $langs->transcountry('ProfId'.$i, $object->country_code)); + $action = ($action=='add'?'create':'edit'); + } } } + if (! $error) { if ($action == 'add') @@ -293,7 +312,7 @@ if (empty($reshook)) // Gestion du logo de la société } else - { + { $error=$object->error; $errors=$object->errors; } @@ -834,7 +853,13 @@ else if ($idprof!='-') { if (($j % 2) == 0) print ''; - print ''; @@ -907,30 +932,26 @@ else print ''; // Local Taxes - // TODO add specific function by country - if($mysoc->country_code=='ES') + if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") - { - print ''; + print ''; - } - elseif($mysoc->localtax1_assuj=="1") - { - print ''; - } - elseif($mysoc->localtax2_assuj=="1") - { - print ''; - } + } + elseif($mysoc->localtax1_assuj=="1") + { + print ''; + } + elseif($mysoc->localtax2_assuj=="1") + { + print ''; } if (! empty($conf->global->MAIN_MULTILANGS)) @@ -1121,7 +1142,7 @@ else print '
"; print dol_print_date($db->jdate($objp->datef))."".price($objp->total_ht)."'.$fac->LibStatut($objp->paye,$objp->statut,5).''.$supplierinvoicestatic->LibStatut($objp->paye,$objp->statut,5).'
'.$langs->trans("Name").''.$langs->trans("Description").''.$langs->trans("MustBeUnique").''.$langs->trans("MustBeMandatory").'
'.$profid[$i][0]."\n"; - print $profid[$i][1]; - print '
'.$profid[$i][0]."\n"; + print $profid[$i][1]; + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print ''; + print img_picto($langs->trans("Activated"),'switch_on'); + print ''; + print img_picto($langs->trans("Disabled"),'switch_off'); + print '
'; - print img_picto($langs->trans("Activated"),'switch_on'); - print ''; - print img_picto($langs->trans("Disabled"),'switch_off'); - print '
'.$idprof.''; + + $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; + if(empty($conf->global->$idprof_mandatory)) + print ''.$idprof.''; + else + print ''.$idprof.''; + $key='idprof'.$i; print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code); print '
'.$langs->trans('Capital').' '.$langs->trans("Currency".$conf->currency).'
'.$langs->trans("LocalTax1IsUsedES").''; - print $form->selectyesno('localtax1assuj_value',0,1); - print ''.$langs->trans("LocalTax2IsUsedES").''; - print $form->selectyesno('localtax2assuj_value',0,1); - print '
'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).''; + print $form->selectyesno('localtax1assuj_value',0,1); + print ''.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).''; + print $form->selectyesno('localtax2assuj_value',0,1); + print '
'.$langs->trans("LocalTax1IsUsedES").''; - print $form->selectyesno('localtax1assuj_value',0,1); - print '
'.$langs->trans("LocalTax2IsUsedES").''; - print $form->selectyesno('localtax2assuj_value',0,1); - print '
'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).''; + print $form->selectyesno('localtax1assuj_value',0,1); + print '
'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).''; + print $form->selectyesno('localtax2assuj_value',0,1); + print '
'; // Name - print ''; + print ''; // Prefix if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field @@ -1130,12 +1151,12 @@ else // It does not change the prefix mode using the auto numbering prefix if (($prefixCustomerIsUsed || $prefixSupplierIsUsed) && $object->prefix_comm) { - print ''; + print ''; print $object->prefix_comm; } else { - print ''; + print ''; } print ''; } @@ -1275,7 +1296,13 @@ else if ($idprof!='-') { if (($j % 2) == 0) print ''; - print ''; @@ -1322,31 +1349,27 @@ else print ''; // Local Taxes - // TODO add specific function by country - if($mysoc->country_code=='ES') + if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") - { - print ''; + print ''; - } - elseif($mysoc->localtax1_assuj=="1") - { - print ''; + } + elseif($mysoc->localtax1_assuj=="1") + { + print ''; - } - elseif($mysoc->localtax2_assuj=="1") - { - print ''; - } + } + elseif($mysoc->localtax2_assuj=="1") + { + print ''; } // Type - Size @@ -1642,30 +1665,26 @@ else print ''; // Local Taxes - // TODO add specific function by country - if($mysoc->country_code=='ES') + if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") { - if($mysoc->localtax1_assuj=="1" && $mysoc->localtax2_assuj=="1") - { - print ''; + print ''; - } - elseif($mysoc->localtax1_assuj=="1") - { - print ''; - } - elseif($mysoc->localtax2_assuj=="1") - { - print ''; - } + } + elseif($mysoc->localtax1_assuj=="1") + { + print ''; + } + elseif($mysoc->localtax2_assuj=="1") + { + print ''; } // Type + Staff diff --git a/htdocs/user/admin/user_extrafields.php b/htdocs/user/admin/user_extrafields.php new file mode 100644 index 00000000000..dbe4ace030b --- /dev/null +++ b/htdocs/user/admin/user_extrafields.php @@ -0,0 +1,157 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2012 Regis Houssin + * + * 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/adherents/admin/adherent_extrafields.php + * \ingroup member + * \brief Page to setup extra fields of members + */ + +require '../../main.inc.php'; +require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; + +$langs->load("users"); +$langs->load("admin"); + +$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='user'; + +if (!$user->admin) accessforbidden(); + + +/* + * Actions + */ + +require DOL_DOCUMENT_ROOT.'/core/admin_extrafields.inc.php'; + + + +/* + * View + */ + +$textobject=$langs->transnoentitiesnoconv("Users"); + +$help_url='EN:Module_Users|FR:Module_Utilisateurs|ES:Módulo_Usuarios'; +llxHeader('',$langs->trans("UsersSetup"),$help_url); + + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("UsersSetup"),$linkback,'setup'); + + +$head = user_admin_prepare_head(); + +dol_fiche_head($head, 'attributes', $langs->trans("User"), 0, 'user'); + + +print $langs->trans("DefineHereComplementaryAttributes",$textobject).'
'."\n"; +print '
'; + +dol_htmloutput_errors($mesg); + +// Load attribute_label +$extrafields->fetch_name_optionals_label($elementtype); + +print "
'.$langs->trans('ThirdPartyName').'
'.$langs->trans('ThirdPartyName').'
'.$idprof.''; + + $idprof_mandatory ='SOCIETE_IDPROF'.($i).'_MANDATORY'; + if(empty($conf->global->$idprof_mandatory)) + print ''.$idprof.''; + else + print ''.$idprof.''; + $key='idprof'.$i; print $formcompany->get_input_id_prof($i,'idprof'.$i,$object->$key,$object->country_code); print '
'.$langs->trans("LocalTax1IsUsedES").''; - print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); - print ''.$langs->trans("LocalTax2IsUsedES").''; - print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); - print '
'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).''; + print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); + print ''.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).''; + print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); + print '
'.$langs->trans("LocalTax1IsUsedES").''; - print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); - print '
'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).''; + print $form->selectyesno('localtax1assuj_value',$object->localtax1_assuj,1); + print '
'.$langs->trans("LocalTax2IsUsedES").''; - print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); - print '
'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).''; + print $form->selectyesno('localtax2assuj_value',$object->localtax2_assuj,1); + print '
'.$langs->trans("LocalTax1IsUsedES").''; - print yn($object->localtax1_assuj); - print ''.$langs->trans("LocalTax2IsUsedES").''; - print yn($object->localtax2_assuj); - print '
'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).''; + print yn($object->localtax1_assuj); + print ''.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).''; + print yn($object->localtax2_assuj); + print '
'.$langs->trans("LocalTax1IsUsedES").''; - print yn($object->localtax1_assuj); - print '
'.$langs->trans("LocalTax2IsUsedES").''; - print yn($object->localtax2_assuj); - print '
'.$langs->trans("LocalTax1IsUsed",$mysoc->country_code).''; + print yn($object->localtax1_assuj); + print '
'.$langs->trans("LocalTax2IsUsed",$mysoc->country_code).''; + print yn($object->localtax2_assuj); + 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(); +?> diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 314a8b6d584..abf8ef515c8 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -1189,6 +1189,25 @@ class User extends CommonObject } } + // 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('userdao')); + $parameters=array('socid'=>$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 (! $error && ! $notrigger) { // Appel des triggers diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 3921afa6a6b..778617f686d 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -33,6 +33,7 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php'; 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/usergroups.lib.php'; +require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.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->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php'); @@ -85,6 +86,8 @@ $langs->load("companies"); $langs->load("ldap"); $form = new Form($db); +$object = new User($db); +$extrafields = new ExtraFields($db); /** @@ -95,9 +98,8 @@ if ($action == 'confirm_disable' && $confirm == "yes" && $candisableuser) { if ($id <> $user->id) { - $edituser = new User($db); - $edituser->fetch($id); - $edituser->setstatus(0); + $object->fetch($id); + $object->setstatus(0); header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } @@ -106,12 +108,11 @@ if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) { if ($id <> $user->id) { - $edituser = new User($db); - $edituser->fetch($id); + $object->fetch($id); if (!empty($conf->file->main_limit_users)) { - $nb = $edituser->getNbOfUsers("active"); + $nb = $object->getNbOfUsers("active"); if ($nb >= $conf->file->main_limit_users) { $message='
'.$langs->trans("YourQuotaOfUsersIsReached").'
'; @@ -120,7 +121,7 @@ if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) if (! $message) { - $edituser->setstatus(1); + $object->setstatus(1); header("Location: ".$_SERVER['PHP_SELF'].'?id='.$id); exit; } @@ -131,9 +132,9 @@ if ($action == 'confirm_delete' && $confirm == "yes" && $candisableuser) { if ($id <> $user->id) { - $edituser = new User($db); - $edituser->id=$id; - $result = $edituser->delete(); + $object = new User($db); + $object->id=$id; + $result = $object->delete(); if ($result < 0) { $langs->load("errors"); @@ -161,11 +162,9 @@ if ($action == 'add' && $canadduser) $action="create"; // Go back to create page } - $edituser = new User($db); - if (! empty($conf->file->main_limit_users)) // If option to limit users is set { - $nb = $edituser->getNbOfUsers("active"); + $nb = $object->getNbOfUsers("active"); if ($nb >= $conf->file->main_limit_users) { $message='
'.$langs->trans("YourQuotaOfUsersIsReached").'
'; @@ -175,57 +174,66 @@ if ($action == 'add' && $canadduser) if (! $message) { - $edituser->lastname = $_POST["nom"]; - $edituser->firstname = $_POST["prenom"]; - $edituser->login = $_POST["login"]; - $edituser->admin = $_POST["admin"]; - $edituser->office_phone = $_POST["office_phone"]; - $edituser->office_fax = $_POST["office_fax"]; - $edituser->user_mobile = $_POST["user_mobile"]; - $edituser->email = $_POST["email"]; - $edituser->job = $_POST["job"]; - $edituser->signature = $_POST["signature"]; - $edituser->note = $_POST["note"]; - $edituser->ldap_sid = $_POST["ldap_sid"]; + $object->lastname = $_POST["nom"]; + $object->firstname = $_POST["prenom"]; + $object->login = $_POST["login"]; + $object->admin = $_POST["admin"]; + $object->office_phone = $_POST["office_phone"]; + $object->office_fax = $_POST["office_fax"]; + $object->user_mobile = $_POST["user_mobile"]; + $object->email = $_POST["email"]; + $object->job = $_POST["job"]; + $object->signature = $_POST["signature"]; + $object->note = $_POST["note"]; + $object->ldap_sid = $_POST["ldap_sid"]; + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=GETPOST($key); + } + } + // FIXME external module - $edituser->webcal_login = $_POST["webcal_login"]; - $edituser->phenix_login = $_POST["phenix_login"]; - $edituser->phenix_pass = $_POST["phenix_pass"]; + $object->webcal_login = $_POST["webcal_login"]; + $object->phenix_login = $_POST["phenix_login"]; + $object->phenix_pass = $_POST["phenix_pass"]; // If multicompany is off, admin users must all be on entity 0. if (! empty($conf->multicompany->enabled)) { if (! empty($_POST["superadmin"])) { - $edituser->entity = 0; + $object->entity = 0; } else if ($conf->multicompany->transverse_mode) { - $edituser->entity = 1; // all users in master entity + $object->entity = 1; // all users in master entity } else { - $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + $object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); } } else if (! empty($_POST["admin"])) { - $edituser->entity=0; + $object->entity=0; } else { - $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + $object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); } $db->begin(); - $id = $edituser->create($user); + $id = $object->create($user); if ($id > 0) { if (isset($_POST['password']) && trim($_POST['password'])) { - $edituser->setPassword($user,trim($_POST['password'])); + $object->setPassword($user,trim($_POST['password'])); } $db->commit(); @@ -237,8 +245,8 @@ if ($action == 'add' && $canadduser) { $langs->load("errors"); $db->rollback(); - if (is_array($edituser->errors) && count($edituser->errors)) $message='
'.join('
',$langs->trans($edituser->errors)).'
'; - else $message='
'.$langs->trans($edituser->error).'
'; + if (is_array($object->errors) && count($object->errors)) $message='
'.join('
',$langs->trans($object->errors)).'
'; + else $message='
'.$langs->trans($object->error).'
'; $action="create"; // Go back to create page } @@ -254,10 +262,9 @@ if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield) $editgroup->fetch($group); $editgroup->oldcopy=dol_clone($editgroup); - $edituser = new User($db); - $edituser->fetch($id); - if ($action == 'addgroup') $edituser->SetInGroup($group,($conf->multicompany->transverse_mode?GETPOST("entity"):$editgroup->entity)); - if ($action == 'removegroup') $edituser->RemoveFromGroup($group,($conf->multicompany->transverse_mode?GETPOST("entity"):$editgroup->entity)); + $object->fetch($id); + if ($action == 'addgroup') $object->SetInGroup($group,($conf->multicompany->transverse_mode?GETPOST("entity"):$editgroup->entity)); + if ($action == 'removegroup') $object->RemoveFromGroup($group,($conf->multicompany->transverse_mode?GETPOST("entity"):$editgroup->entity)); if ($result > 0) { @@ -266,7 +273,7 @@ if (($action == 'addgroup' || $action == 'removegroup') && $caneditfield) } else { - $message.=$edituser->error; + $message.=$object->error; } } } @@ -291,83 +298,91 @@ if ($action == 'update' && ! $_POST["cancel"]) if (! $message) { $db->begin(); - $edituser = new User($db); - $edituser->fetch($id); + $object->fetch($id); - $edituser->oldcopy=dol_clone($edituser); + $object->oldcopy=dol_clone($object); - $edituser->lastname = $_POST["nom"]; - $edituser->firstname = $_POST["prenom"]; - $edituser->login = $_POST["login"]; - $edituser->pass = $_POST["password"]; - $edituser->admin = $_POST["admin"]; - $edituser->office_phone = $_POST["office_phone"]; - $edituser->office_fax = $_POST["office_fax"]; - $edituser->user_mobile = $_POST["user_mobile"]; - $edituser->email = $_POST["email"]; - $edituser->job = $_POST["job"]; - $edituser->signature = $_POST["signature"]; - $edituser->openid = $_POST["openid"]; + $object->lastname = $_POST["nom"]; + $object->firstname = $_POST["prenom"]; + $object->login = $_POST["login"]; + $object->pass = $_POST["password"]; + $object->admin = $_POST["admin"]; + $object->office_phone = $_POST["office_phone"]; + $object->office_fax = $_POST["office_fax"]; + $object->user_mobile = $_POST["user_mobile"]; + $object->email = $_POST["email"]; + $object->job = $_POST["job"]; + $object->signature = $_POST["signature"]; + $object->openid = $_POST["openid"]; + // Get extra fields + foreach($_POST as $key => $value) + { + if (preg_match("/^options_/",$key)) + { + $object->array_options[$key]=GETPOST($key); + } + } + // FIXME external module - $edituser->webcal_login = $_POST["webcal_login"]; - $edituser->phenix_login = $_POST["phenix_login"]; - $edituser->phenix_pass = $_POST["phenix_pass"]; + $object->webcal_login = $_POST["webcal_login"]; + $object->phenix_login = $_POST["phenix_login"]; + $object->phenix_pass = $_POST["phenix_pass"]; if (! empty($conf->multicompany->enabled)) { if (! empty($_POST["superadmin"])) { - $edituser->entity = 0; + $object->entity = 0; } else if ($conf->multicompany->transverse_mode) { - $edituser->entity = 1; // all users in master entity + $object->entity = 1; // all users in master entity } else { - $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + $object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); } } else if(! empty($_POST["admin"])) { - $edituser->entity=0; + $object->entity=0; } else { - $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + $object->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); } - if (GETPOST('deletephoto')) $edituser->photo=''; - if (! empty($_FILES['photo']['name'])) $edituser->photo = dol_sanitizeFileName($_FILES['photo']['name']); + if (GETPOST('deletephoto')) $object->photo=''; + if (! empty($_FILES['photo']['name'])) $object->photo = dol_sanitizeFileName($_FILES['photo']['name']); - $ret=$edituser->update($user); + $ret=$object->update($user); if ($ret < 0) { if ($db->errno() == 'DB_ERROR_RECORD_ALREADY_EXISTS') { $langs->load("errors"); - $message.='
'.$langs->trans("ErrorLoginAlreadyExists",$edituser->login).'
'; + $message.='
'.$langs->trans("ErrorLoginAlreadyExists",$object->login).'
'; } else { - $message.='
'.$edituser->error.'
'; + $message.='
'.$object->error.'
'; } } - if ($ret >=0 && ! count($edituser->errors)) + if ($ret >=0 && ! count($object->errors)) { - if (GETPOST('deletephoto') && $edituser->photo) + if (GETPOST('deletephoto') && $object->photo) { - $fileimg=$conf->user->dir_output.'/'.get_exdir($edituser->id,2,0,1).'/logos/'.$edituser->photo; - $dirthumbs=$conf->user->dir_output.'/'.get_exdir($edituser->id,2,0,1).'/logos/thumbs'; + $fileimg=$conf->user->dir_output.'/'.get_exdir($object->id,2,0,1).'/logos/'.$object->photo; + $dirthumbs=$conf->user->dir_output.'/'.get_exdir($object->id,2,0,1).'/logos/thumbs'; dol_delete_file($fileimg); dol_delete_dir_recursive($dirthumbs); } if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) { - $dir= $conf->user->dir_output . '/' . get_exdir($edituser->id,2,0,1); + $dir= $conf->user->dir_output . '/' . get_exdir($object->id,2,0,1); dol_mkdir($dir); @@ -394,7 +409,7 @@ if ($action == 'update' && ! $_POST["cancel"]) } } - if ($ret >= 0 && ! count($edituser->errors)) + if ($ret >= 0 && ! count($object->errors)) { $message.='
'.$langs->trans("UserModified").'
'; $db->commit(); @@ -407,15 +422,14 @@ if ($action == 'update' && ! $_POST["cancel"]) } else if ($caneditpassword) // Case we can edit only password { - $edituser = new User($db); - $edituser->fetch($id); + $object->fetch($id); - $edituser->oldcopy=dol_clone($edituser); + $object->oldcopy=dol_clone($object); - $ret=$edituser->setPassword($user,$_POST["password"]); + $ret=$object->setPassword($user,$_POST["password"]); if ($ret < 0) { - $message.='
'.$edituser->error.'
'; + $message.='
'.$object->error.'
'; } } } @@ -424,10 +438,9 @@ if ($action == 'update' && ! $_POST["cancel"]) if ((($action == 'confirm_password' && $confirm == 'yes') || ($action == 'confirm_passwordsend' && $confirm == 'yes')) && $caneditpassword) { - $edituser = new User($db); - $edituser->fetch($id); + $object->fetch($id); - $newpassword=$edituser->setPassword($user,''); + $newpassword=$object->setPassword($user,''); if ($newpassword < 0) { // Echec @@ -438,15 +451,15 @@ if ((($action == 'confirm_password' && $confirm == 'yes') // Succes if ($action == 'confirm_passwordsend' && $confirm == 'yes') { - if ($edituser->send_password($user,$newpassword) > 0) + if ($object->send_password($user,$newpassword) > 0) { - $message = '
'.$langs->trans("PasswordChangedAndSentTo",$edituser->email).'
'; + $message = '
'.$langs->trans("PasswordChangedAndSentTo",$object->email).'
'; //$message.=$newpassword; } else { $message = '
'.$langs->trans("PasswordChangedTo",$newpassword).'
'; - $message.= '
'.$edituser->error.'
'; + $message.= '
'.$object->error.'
'; } } else @@ -517,6 +530,9 @@ if ($action == 'adduserldap') * View */ +// fetch optionals attributes and labels +$extralabels=$extrafields->fetch_name_optionals_label('user'); + llxHeader('',$langs->trans("UserCard")); $form = new Form($db); @@ -853,8 +869,22 @@ if (($action == 'create') || ($action == 'adduserldap')) $doleditor->Create(); print "
'; + print $extrafields->showInputField($key,$value); + print '
'.$langs->trans("Ref").''; - print $form->showrefnav($fuser,'id','',$user->rights->user->user->lire || $user->admin); + print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").''.$fuser->nom.''.$object->nom.''; - print $form->showphoto('userphoto',$fuser,100); + print $form->showphoto('userphoto',$object,100); print '
'.$langs->trans("Firstname").''.$fuser->prenom.''.$object->prenom.'
'.$langs->trans("PostOrFunction").''.$fuser->job.''.$object->job.'
'.$langs->trans("Login").''.$langs->trans("LoginAccountDisableInDolibarr").''.$fuser->login.''.$object->login.'
'.$langs->trans("Password").''; - if ($fuser->pass) print preg_replace('/./i','*',$fuser->pass); + if ($object->pass) print preg_replace('/./i','*',$object->pass); else { - if ($user->admin) print $langs->trans("Crypted").': '.$fuser->pass_indatabase_crypted; + if ($user->admin) print $langs->trans("Crypted").': '.$object->pass_indatabase_crypted; else print $langs->trans("Hidden"); } print "
'.$langs->trans("Administrator").''; - if (! empty($conf->multicompany->enabled) && $fuser->admin && ! $fuser->entity) + if (! empty($conf->multicompany->enabled) && $object->admin && ! $object->entity) { - print $form->textwithpicto(yn($fuser->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); + print $form->textwithpicto(yn($object->admin),$langs->trans("SuperAdministratorDesc"),1,"superadmin"); } - else if ($fuser->admin) + else if ($object->admin) { - print $form->textwithpicto(yn($fuser->admin),$langs->trans("AdministratorDesc"),1,"admin"); + print $form->textwithpicto(yn($object->admin),$langs->trans("AdministratorDesc"),1,"admin"); } else { - print yn($fuser->admin); + print yn($object->admin); } print '
'.$langs->trans("Entity").''; - if ($fuser->admin && ! $fuser->entity) + if ($object->admin && ! $object->entity) { print $langs->trans("AllEntities"); } else { - $mc->getInfo($fuser->entity); + $mc->getInfo($object->entity); print $mc->label; } print "
'.$langs->trans("Type").''; - if ($fuser->societe_id) + if ($object->societe_id) { print $form->textwithpicto($langs->trans("External"),$langs->trans("InternalExternalDesc")); } - else if ($fuser->ldap_sid) + else if ($object->ldap_sid) { print $langs->trans("DomainUser",$ldap->domainFQDN); } @@ -1126,52 +1159,51 @@ else // Tel pro print '
'.$langs->trans("PhonePro").''.dol_print_phone($fuser->office_phone,'',0,0,1).''.dol_print_phone($object->office_phone,'',0,0,1).'
'.$langs->trans("PhoneMobile").''.dol_print_phone($fuser->user_mobile,'',0,0,1).''.dol_print_phone($object->user_mobile,'',0,0,1).'
'.$langs->trans("Fax").''.dol_print_phone($fuser->office_fax,'',0,0,1).''.dol_print_phone($object->office_fax,'',0,0,1).'
'.$langs->trans("EMail").''.dol_print_email($fuser->email,0,0,1).''.dol_print_email($object->email,0,0,1).'
'.$langs->trans('Signature').''; - print dol_textishtml($fuser->signature)?$fuser->signature:dol_nl2br($fuser->signature,1,false); + print dol_textishtml($object->signature)?$object->signature:dol_nl2br($object->signature,1,false); print "
'.$langs->trans("Status").''; - print $fuser->getLibStatut(4); + print $object->getLibStatut(4); print '
'.$langs->trans("LastConnexion").''.dol_print_date($fuser->datelastlogin,"dayhour").''.dol_print_date($object->datelastlogin,"dayhour").'
'.$langs->trans("PreviousConnexion").''.dol_print_date($fuser->datepreviouslogin,"dayhour").''.dol_print_date($object->datepreviouslogin,"dayhour").'
'.$langs->trans("url_openid").''.$fuser->openid.''.$object->openid.'
'.$langs->trans("LoginWebcal").''.$fuser->webcal_login.' '.$object->webcal_login.' 
'.$langs->trans("LoginPhenix").''.$fuser->phenix_login.' '.$object->phenix_login.' 
'.$langs->trans("PassPhenix").''.preg_replace('/./i','*',$fuser->phenix_pass_crypted).' '.preg_replace('/./i','*',$object->phenix_pass_crypted).' 
'.$langs->trans("LinkToCompanyContact").''; - if (isset($fuser->societe_id) && $fuser->societe_id > 0) + if (isset($object->societe_id) && $object->societe_id > 0) { $societe = new Societe($db); - $societe->fetch($fuser->societe_id); + $societe->fetch($object->societe_id); print $societe->getNomUrl(1,''); } else { print $langs->trans("ThisUserIsNot"); } - if (! empty($fuser->contact_id)) + if (! empty($object->contact_id)) { $contact = new Contact($db); - $contact->fetch($fuser->contact_id); - if ($fuser->societe_id > 0) print ' / '; + $contact->fetch($object->contact_id); + if ($object->societe_id > 0) print ' / '; else print '
'; - print ''.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).''; + print ''.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).''; } print '
'.$langs->trans("LinkedToDolibarrMember").''; - if ($fuser->fk_member) + if ($object->fk_member) { $adh=new Adherent($db); - $adh->fetch($fuser->fk_member); + $adh->fetch($object->fk_member); $adh->ref=$adh->getFullname($langs); // Force to show login instead of id print $adh->getNomUrl(1); } @@ -1244,7 +1276,23 @@ else print '
\n"; + // Other attributes + $parameters=array('colspan' => ' colspan="2"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''; + print $extrafields->showOutputField($key,$value); + print ''."\n"; + } + } + + print "\n"; print "\n"; @@ -1255,7 +1303,7 @@ else print '
'; - if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) + if ($caneditfield && (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { if (! empty($conf->global->MAIN_ONLY_LOGIN_ALLOWED)) { @@ -1263,57 +1311,57 @@ else } else { - print ''.$langs->trans("Modify").''; + print ''.$langs->trans("Modify").''; } } - elseif ($caneditpassword && ! $fuser->ldap_sid && - (empty($conf->multicompany->enabled) || ! $user->entity || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) + elseif ($caneditpassword && ! $object->ldap_sid && + (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("EditPassword").''; + print ''.$langs->trans("EditPassword").''; } // Si on a un gestionnaire de generation de mot de passe actif if ($conf->global->USER_PASSWORD_GENERATED != 'none') { - if ($fuser->statut == 0) + if ($object->statut == 0) { print ''.$langs->trans("ReinitPassword").''; } - elseif (($user->id != $id && $caneditpassword) && $fuser->login && !$fuser->ldap_sid && - (empty($conf->multicompany->enabled) || ! $user->entity || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) + elseif (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("ReinitPassword").''; + print ''.$langs->trans("ReinitPassword").''; } - if ($fuser->statut == 0) + if ($object->statut == 0) { print ''.$langs->trans("SendNewPassword").''; } - else if (($user->id != $id && $caneditpassword) && $fuser->login && !$fuser->ldap_sid && - (empty($conf->multicompany->enabled) || ! $user->entity || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) + else if (($user->id != $id && $caneditpassword) && $object->login && !$object->ldap_sid && + (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - if ($fuser->email) print ''.$langs->trans("SendNewPassword").''; + if ($object->email) print ''.$langs->trans("SendNewPassword").''; else print ''.$langs->trans("SendNewPassword").''; } } // Activer - if ($user->id <> $id && $candisableuser && $fuser->statut == 0 && - (empty($conf->multicompany->enabled) || ! $user->entity || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) + if ($user->id <> $id && $candisableuser && $object->statut == 0 && + (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("Reactivate").''; + print ''.$langs->trans("Reactivate").''; } // Desactiver - if ($user->id <> $id && $candisableuser && $fuser->statut == 1 && - (empty($conf->multicompany->enabled) || ! $user->entity || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) + if ($user->id <> $id && $candisableuser && $object->statut == 1 && + (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("DisableUser").''; + print ''.$langs->trans("DisableUser").''; } // Delete if ($user->id <> $id && $candisableuser && - (empty($conf->multicompany->enabled) || ! $user->entity || ($fuser->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) + (empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1))) { - print ''.$langs->trans("DeleteUser").''; + print ''.$langs->trans("DeleteUser").''; } print "
\n"; @@ -1333,7 +1381,7 @@ else $exclude = array(); $usergroup=new UserGroup($db); - $groupslist = $usergroup->listGroupsForUser($fuser->id); + $groupslist = $usergroup->listGroupsForUser($object->id); if (! empty($groupslist)) { @@ -1355,7 +1403,7 @@ else print ''."\n"; print ''."\n"; print '
'.$langs->trans("GroupsToAdd").''; - print $form->select_dolgroups('', 'group', 1, $exclude, 0, '', '', $fuser->entity); + print $form->select_dolgroups('', 'group', 1, $exclude, 0, '', '', $object->entity); print '   '; // Multicompany if (! empty($conf->multicompany->enabled)) @@ -1422,7 +1470,7 @@ else { $mc->getInfo($group_entity); print ($nb > 0 ? ', ' : '').$mc->label; - print ''; + print ''; print img_delete($langs->trans("RemoveFromGroup")); print ''; $nb++; @@ -1432,7 +1480,7 @@ else print ''; if ($caneditgroup && empty($conf->multicompany->transverse_mode)) { - print ''; + print ''; print img_delete($langs->trans("RemoveFromGroup")); print ''; } @@ -1457,15 +1505,15 @@ else * Fiche en mode edition */ - if ($action == 'edit' && ($canedituser || ($user->id == $fuser->id))) + if ($action == 'edit' && ($canedituser || ($user->id == $object->id))) { - print ''; + print ''; print ''; print ''; print ''; print ''; - $rowspan=12; + $rowspan=13; if (! empty($conf->societe->enabled)) $rowspan++; if (! empty($conf->adherent->enabled)) $rowspan++; @@ -1474,7 +1522,7 @@ else print ''; print ''; print ''; @@ -1482,24 +1530,24 @@ else print ""; print ''; print ''; // Photo print '".''; print ''; // Position/Job print ''; print ''; // Login print "".''; print ''; print ''; @@ -1546,13 +1594,13 @@ else // Pass print ''; print '\n"; // Administrator print ''; - if ($fuser->societe_id > 0) + if ($object->societe_id > 0) { print ''; } @@ -1579,11 +1627,11 @@ else print ''; @@ -1647,7 +1695,7 @@ else if (empty($conf->multicompany->transverse_mode) && $conf->entity == 1 && $user->admin && ! $user->entity) { print "".''; - print "\n"; } else @@ -1660,11 +1708,11 @@ else // Type print ''; print '".''; print ''; // Tel mobile print "".''; print ''; // Fax print "".''; print ''; // EMail print "".''; print ''; // Signature print "".''; print ''; // openid @@ -1742,14 +1790,14 @@ else { print "".''; print ''; } @@ -1757,11 +1805,9 @@ else // Statut print ''; print ''; - // Autres caracteristiques issus des autres modules - // Module Webcalendar // TODO external module if (! empty($conf->webcalendar->enabled)) @@ -1769,8 +1815,8 @@ else $langs->load("other"); print "".''; print ''; } @@ -1781,13 +1827,13 @@ else $langs->load("other"); print "".''; print ''; print "".''; print ''; } @@ -1796,16 +1842,16 @@ else { print ''; print ''; print '\n"; } + // Other attributes + $parameters=array('colspan' => ' colspan="2"'); + $reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$object,$action); // Note that $action and $object may have been modified by hook + if (empty($reshook) && ! empty($extrafields->attribute_label)) + { + foreach($extrafields->attribute_label as $key=>$label) + { + $value=(isset($_POST["options_".$key])?$_POST["options_".$key]:$object->array_options["options_".$key]); + print 'attribute_required[$key])) print ' class="fieldrequired"'; + print '>'.$label.''."\n"; + } + } + print '
'.$langs->trans("Ref").''; - print $fuser->id; + print $object->id; print '
'.$langs->trans("Lastname").''; - if ($caneditfield && !$fuser->ldap_sid) + if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { - print ''; - print $fuser->nom; + print ''; + print $object->nom; } print ''; - print $form->showphoto('userphoto',$fuser); + print $form->showphoto('userphoto',$object); if ($caneditfield) { - if ($fuser->photo) print "
\n"; + if ($object->photo) print "
\n"; print ''; - if ($fuser->photo) print ''; + if ($object->photo) print ''; print ''; print ''; print '
'.$langs->trans("Delete").'

'.$langs->trans("Delete").'

'.$langs->trans("PhotoFile").'
'; @@ -1511,34 +1559,34 @@ else // Firstname print "
'.$langs->trans("Firstname").''; - if ($caneditfield && !$fuser->ldap_sid) + if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { - print ''; - print $fuser->prenom; + print ''; + print $object->prenom; } print '
'.$langs->trans("PostOrFunction").''; - print ''; + print ''; print '
'.$langs->trans("Login").''; - if ($user->admin && !$fuser->ldap_sid) + if ($user->admin && !$object->ldap_sid) { - print ''; + print ''; } else { - print ''; - print $fuser->login; + print ''; + print $object->login; } print '
'.$langs->trans("Password").''; - if ($fuser->ldap_sid) + if ($object->ldap_sid) { $text=$langs->trans("DomainPassword"); } else if ($caneditpassword) { - $text=''; + $text=''; if ($dolibarr_main_authentication && $dolibarr_main_authentication == 'http') { $text=$form->textwithpicto($text,$langs->trans("DolibarrInHttpAuthenticationSoPasswordUseless",$dolibarr_main_authentication),1,'warning'); @@ -1560,17 +1608,17 @@ else } else { - $text=preg_replace('/./i','*',$fuser->pass); + $text=preg_replace('/./i','*',$object->pass); } print $text; print "
'.$langs->trans("Administrator").''; - print ''.yn($fuser->admin); + print ''.yn($object->admin); print ' ('.$langs->trans("ExternalUser").')'; print '
'; $nbSuperAdmin = $user->getNbOfUsers('superadmin'); if ($user->admin - && ($user->id != $fuser->id) // Don't downgrade ourself - && ($fuser->entity > 0 || $nbSuperAdmin > 1) // Don't downgrade a superadmin if alone + && ($user->id != $object->id) // Don't downgrade ourself + && ($object->entity > 0 || $nbSuperAdmin > 1) // Don't downgrade a superadmin if alone ) { - print $form->selectyesno('admin',$fuser->admin,1); + print $form->selectyesno('admin',$object->admin,1); if (! empty($conf->multicompany->enabled) && ! $user->entity && empty($conf->multicompany->transverse_mode)) { @@ -1626,16 +1674,16 @@ else '; } - $checked=(($fuser->admin && ! $fuser->entity) ? ' checked' : ''); + $checked=(($object->admin && ! $object->entity) ? ' checked' : ''); print ' '.$langs->trans("SuperAdministrator"); } } else { - $yn = yn($fuser->admin); - print ''; - print ''; - if (! empty($conf->multicompany->enabled) && empty($fuser->entity)) print $form->textwithpicto($yn,$langs->trans("DontDowngradeSuperAdmin"),1,'warning'); + $yn = yn($object->admin); + print ''; + print ''; + if (! empty($conf->multicompany->enabled) && empty($object->entity)) print $form->textwithpicto($yn,$langs->trans("DontDowngradeSuperAdmin"),1,'warning'); else print $yn; } print '
'.$langs->trans("Entity").'".$mc->select_entities($fuser->entity); + print "".$mc->select_entities($object->entity); print "
'.$langs->trans("Type").''; - if ($fuser->societe_id) + if ($object->societe_id) { print $langs->trans("External"); } - else if ($fuser->ldap_sid) + else if ($object->ldap_sid) { print $langs->trans("DomainUser"); } @@ -1678,63 +1726,63 @@ else // Tel pro print "
'.$langs->trans("PhonePro").''; - if ($caneditfield && empty($fuser->ldap_sid)) + if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { - print ''; - print $fuser->office_phone; + print ''; + print $object->office_phone; } print '
'.$langs->trans("PhoneMobile").''; - if ($caneditfield && empty($fuser->ldap_sid)) + if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { - print ''; - print $fuser->user_mobile; + print ''; + print $object->user_mobile; } print '
'.$langs->trans("Fax").''; - if ($caneditfield && empty($fuser->ldap_sid)) + if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { - print ''; - print $fuser->office_fax; + print ''; + print $object->office_fax; } print '
global->USER_MAIL_REQUIRED)?' class="fieldrequired"':'').'>'.$langs->trans("EMail").''; - if ($caneditfield && empty($fuser->ldap_sid)) + if ($caneditfield && empty($object->ldap_sid)) { - print ''; + print ''; } else { - print ''; - print $fuser->email; + print ''; + print $object->email; } print '
'.$langs->trans("Signature").''; - print ''; + print ''; print '
'.$langs->trans("url_openid").''; - if ($caneditfield && !$fuser->ldap_sid) + if ($caneditfield && !$object->ldap_sid) { - print ''; + print ''; } else { - print ''; - print $fuser->openid; + print ''; + print $object->openid; } print '
'.$langs->trans("Status").''; - print $fuser->getLibStatut(4); + print $object->getLibStatut(4); print '
'.$langs->trans("LoginWebcal").''; - if ($caneditfield) print ''; - else print $fuser->webcal_login; + if ($caneditfield) print ''; + else print $object->webcal_login; print '
'.$langs->trans("LoginPhenix").''; - if ($caneditfield) print ''; - else print $fuser->phenix_login; + if ($caneditfield) print ''; + else print $object->phenix_login; print '
'.$langs->trans("PassPhenix").''; - if ($caneditfield) print ''; - else print preg_replace('/./i','*',$fuser->phenix_pass_crypted); + if ($caneditfield) print ''; + else print preg_replace('/./i','*',$object->phenix_pass_crypted); print '
'.$langs->trans("LinkToCompanyContact").''; - if ($fuser->societe_id > 0) + if ($object->societe_id > 0) { $societe = new Societe($db); - $societe->fetch($fuser->societe_id); + $societe->fetch($object->societe_id); print $societe->getNomUrl(1,''); - if ($fuser->contact_id) + if ($object->contact_id) { $contact = new Contact($db); - $contact->fetch($fuser->contact_id); - print ' / '.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).''; + $contact->fetch($object->contact_id); + print ' / '.img_object($langs->trans("ShowContact"),'contact').' '.dol_trunc($contact->getFullName($langs),32).''; } } else @@ -1822,10 +1868,10 @@ else $langs->load("members"); print '
'.$langs->trans("LinkedToDolibarrMember").''; - if ($fuser->fk_member) + if ($object->fk_member) { $adh=new Adherent($db); - $adh->fetch($fuser->fk_member); + $adh->fetch($object->fk_member); $adh->ref=$adh->login; // Force to show login instead of id print $adh->getNomUrl(1); } @@ -1837,6 +1883,22 @@ else print "
'; + print $extrafields->showInputField($key,$value); + print '
'; print '
'; @@ -1850,7 +1912,7 @@ else print ''; } - if (! empty($conf->ldap->enabled) && ! empty($fuser->ldap_sid)) $ldap->close; + if (! empty($conf->ldap->enabled) && ! empty($object->ldap_sid)) $ldap->close; } }