diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index 2c22e83f786..09cac93b0b2 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -316,6 +316,32 @@ class Form return $ret; } + /** + * Output edit in place form + * + * @param string $fieldname Name of the field + * @param object $object Object + * @param boolean $perm Permission to allow button to edit parameter. Set it to 0 to have a not edited field. + * @param string $typeofdata Type of data ('string' by default, 'email', 'amount:99', 'numeric:99', 'text' or 'textarea:rows:cols', 'datepicker' ('day' do not work, don't know why), 'ckeditor:dolibarr_zzz:width:height:savemethod:1:rows:cols', 'select;xxx[:class]'...) + * @return string HTML code for the edit of alternative language + */ + public function widgetForTranslation($htmlname, $object, $perm, $typeofdata = 'string') { + global $conf, $langs; + + $result = ''; + + if (! empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE)) { + $result ='
'; + + $s=picto_from_langcode($conf->global->PDF_USE_ALSO_LANGUAGE_CODE); + $result .= $s; + + $result .= '
'; + } + + return $result; + } + /** * Output edit in place form * diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index b1eb3778af8..7e46cdefbad 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1982,5 +1982,5 @@ MakeAnonymousPing=Make an anonymous Ping '+1' to the Dolibarr foundation server FeatureNotAvailableWithReceptionModule=Feature not available when module Reception is enabled EmailTemplate=Template for email EMailsWillHaveMessageID=Emails will have a tag 'References' matching this syntax -PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some text title in your PDF duplicated in 2 different languages in the same generate PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF. +PDF_USE_ALSO_LANGUAGE_CODE=If you want to have some texts in your PDF duplicated in 2 different languages in the same generated PDF, you must set here this second language so generated PDF will contains 2 different languages in same page, the one chosen when generating PDF and this one (only few PDF templates support this). Keep empty for 1 language per PDF. FafaIconSocialNetworksDesc=Enter here the code of a FontAwesome icon. If you don't know what is FontAwesome, you can use the generic value fa-address-book. diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index edc00088c39..d8c9ec9da70 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -98,6 +98,13 @@ if (!empty($canvas)) // Security check $result = restrictedArea($user, 'societe', $socid, '&societe', '', 'fk_soc', 'rowid', $objcanvas); +$permissiontoread = $user->rights->societe->lire; +$permissiontoadd = $user->rights->societe->creer; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php +$permissiontodelete = $user->rights->societe->delete || ($permissiontoadd && isset($object->status) && $object->status == 0); +$permissionnote = $user->rights->societe->creer; // Used by the include of actions_setnotes.inc.php +$permissiondellink = $user->rights->societe->creer; // Used by the include of actions_dellink.inc.php +$upload_dir = $conf->societe->multidir_output[isset($object->entity) ? $object->entity : 1]; + /* * Actions @@ -1186,7 +1193,7 @@ else print ''; // Name, firstname - print 'global->SOCIETE_USEPREFIX) ? ' colspan="3"' : '').'>'; - print ''; + print ''; + print $form->widgetForTranslation("name", $object, $permissiontoadd); + print ''; if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field { print ''; @@ -1249,7 +1258,7 @@ else { // Supplier print ''; - print ''; // Barcode if (!empty($conf->barcode->enabled)) { - print ''; + print ''; print ''; } // Address - print ''; + print ''; print ''; + print ''; + print $form->widgetForTranslation("address", $object, $permissiontoadd); + print ''; // Zip / Town - print ''; if ($conf->browser->layout == 'phone') print ''; - print ''; // Country - print ''; diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index ad5c66a50b8..e61c98e3267 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -712,6 +712,7 @@ class Societe extends CommonObject */ public $multicurrency_code; + /** * Constructor *
'; + print '
'; if ($object->particulier || $private) { print ''.$langs->trans('ThirdPartyName').' / '.$langs->trans('LastName', 'name').''; @@ -1196,7 +1203,9 @@ else print ''.$form->editfieldkey('ThirdPartyName', 'name', '', $object, 0).''; } print ''.$langs->trans('Prefix').'
'.$form->editfieldkey('Vendor', 'fournisseur', '', $object, 0, 'string', '', 1).''; + print ''.$form->editfieldkey('Vendor', 'fournisseur', '', $object, $permissiontoadd, 'string', '', 1).''; $default = -1; if (!empty($conf->global->THIRDPARTY_SUPPLIER_BY_DEFAULT)) $default = 1; print $form->selectyesno("fournisseur", (GETPOST('fournisseur', 'int') != '' ?GETPOST('fournisseur', 'int') : (GETPOST("type", 'alpha') == '' ? $default : $object->fournisseur)), 1, 0, (GETPOST("type", 'alpha') == '' ? 1 : 0)); @@ -1261,7 +1270,7 @@ else print ''; if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) { - print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, 0); + print $form->editfieldkey('SupplierCode', 'supplier_code', '', $object, $permissiontoadd); } print ''; if (!empty($conf->fournisseur->enabled) && !empty($user->rights->fournisseur->lire)) @@ -1279,35 +1288,40 @@ else } // Status - print '
'.$form->editfieldkey('Status', 'status', '', $object, 0).''; + print '
'.$form->editfieldkey('Status', 'status', '', $object, $permissiontoadd).''; print $form->selectarray('status', array('0'=>$langs->trans('ActivityCeased'), '1'=>$langs->trans('InActivity')), 1); print '
'.$form->editfieldkey('Gencod', 'barcode', '', $object, 0).'
'.$form->editfieldkey('Gencod', 'barcode', '', $object, $permissiontoadd).''; print '
'.$form->editfieldkey('Address', 'address', '', $object, 0).'
'; + print $form->editfieldkey('Address', 'address', '', $object, $permissiontoadd); + print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, 0).''; + print '
'.$form->editfieldkey('Zip', 'zipcode', '', $object, $permissiontoadd).''; print $formcompany->select_ziptown($object->zip, 'zipcode', array('town', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); print '
'.$form->editfieldkey('Town', 'town', '', $object, 0).''; + print ''.$form->editfieldkey('Town', 'town', '', $object, $permissiontoadd).''; print $formcompany->select_ziptown($object->town, 'town', array('zipcode', 'selectcountry_id', 'state_id'), 0, 0, '', 'maxwidth100 quatrevingtpercent'); + print $form->widgetForTranslation("town", $object, $permissiontoadd); print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, 0).''; + print '
'.$form->editfieldkey('Country', 'selectcountry_id', '', $object, $permissiontoadd).''; print $form->select_country((GETPOST('country_id') != '' ?GETPOST('country_id') : $object->country_id)); if ($user->admin) print info_admin($langs->trans("YouCanChangeValuesForThisListFromDictionarySetup"), 1); print '