From ea47cebe6fd8cbfa53550f8fd707c8c2ca786b19 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 15 Sep 2010 08:36:13 +0000 Subject: [PATCH] New: task #10473 : Option MAIN_PROFIDx_IN_ADDRESS must no more be hidden --- ChangeLog | 1 + htdocs/admin/company.php | 6 +- htdocs/admin/ihm.php | 204 ++++++++++++++++++-------- htdocs/core/class/translate.class.php | 8 +- htdocs/langs/en_US/admin.lang | 1 + htdocs/langs/fr_FR/admin.lang | 1 + htdocs/lib/doleditor.class.php | 6 +- 7 files changed, 155 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index aad2a119a31..e40a703baa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ English Dolibarr ChangeLog ***** ChangeLog for 3.0 compared to 2.9 ***** For users: +- New: task #10473 : Option MAIN_PROFIDx_IN_ADDRESS must no more be hidden. - New: Can generate business card for on particular member. - New: Task #10553 : Can attach files on members card. - New: Can filter on payment type and bank account in payment lists. diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 3a35c59f42d..f161d979afa 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -617,7 +617,10 @@ else $var=true; $var=!$var; - print ''.$langs->trans("CompanyName").'' . $conf->global->MAIN_INFO_SOCIETE_NOM . ''; + print ''.$langs->trans("CompanyName").''; + if (! empty($conf->global->MAIN_INFO_SOCIETE_NOM)) print $conf->global->MAIN_INFO_SOCIETE_NOM; + else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyName")).''; + print ''; $var=!$var; print ''.$langs->trans("CompanyAddress").'' . nl2br($conf->global->MAIN_INFO_SOCIETE_ADRESSE) . ''; @@ -636,6 +639,7 @@ else print $img?$img.' ':''; print getCountry($pays_code,1); } + else print img_warning().' '.$langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("CompanyCountry")).''; print ''; $var=!$var; diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 2dcb127ebaf..0c08775c469 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -83,6 +83,10 @@ if (isset($_POST["action"]) && $_POST["action"] == 'update') dolibarr_set_const($db, "MAIN_HELP_DISABLELINK", $_POST["MAIN_HELP_DISABLELINK"],'chaine',0,'',0); // Param for all entities dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", $_POST["MAIN_BUGTRACK_ENABLELINK"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PROFID1_IN_ADDRESS", $_POST["MAIN_PROFID1_IN_ADDRESS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PROFID2_IN_ADDRESS", $_POST["MAIN_PROFID2_IN_ADDRESS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PROFID3_IN_ADDRESS", $_POST["MAIN_PROFID3_IN_ADDRESS"],'chaine',0,'',$conf->entity); + dolibarr_set_const($db, "MAIN_PROFID4_IN_ADDRESS", $_POST["MAIN_PROFID4_IN_ADDRESS"],'chaine',0,'',$conf->entity); $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer @@ -116,6 +120,7 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit clearstatcache(); $var=true; + print_fiche_titre($langs->trans("Language"),'','').'
'; print ''; print ''; print ''; @@ -137,6 +142,34 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit print ''; print ''; + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'  

'."\n"; + + + // Themes + show_theme('',1); + print '
'; + + + // Liste des zone de recherche permanantes supportees + print ''; + print ''; + $var=True; + foreach ($searchform as $key => $value) + { + $var=!$var; + print ''; + } + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; + print $html->selectyesno($searchform[$key],$searchformconst[$key],1); + print '
'; + print '
'; + + // Other + print ''; + print ''; + print ''; + print ''; + // Show logo $var=!$var; print ''; print ''; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
'.$langs->trans("EnableShowLogo").''; @@ -213,32 +246,6 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit print ' 

'; - - - // Themes - show_theme('',1); - print '
'; - - - // Liste des zone de recherche permanantes supportees - print ''; - print ''; - $var=True; - foreach ($searchform as $key => $value) - { - $var=!$var; - print ''; - } - print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").'
'.$searchformtitle[$key].''; - print $html->selectyesno($searchform[$key],$searchformconst[$key],1); - print '
'; - print '
'; - - $var=true; - print ''; - print ''; - // Hide helpcenter link on login page $var=!$var; print ''; + print ''."\n"; // Message of the day on home page $var=!$var; print ''; + print ''."\n"; /* // Show bugtrack link @@ -282,8 +289,42 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit print ''; */ + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DisableLinkToHelpCenter").''; @@ -260,17 +267,17 @@ if (isset($_GET["action"]) && $_GET["action"] == 'edit') // Edit print '
'.$langs->trans("MessageLogin").''; // Editeur wysiwyg require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('main_home',$conf->global->MAIN_HOME,158,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,ROWS_5,90); + $doleditor=new DolEditor('main_home',$conf->global->MAIN_HOME,142,'dolibarr_notes','In',false,true,true,ROWS_4,90); $doleditor->Create(); - print '
'.$langs->trans("MessageOfDay").''; require_once(DOL_DOCUMENT_ROOT."/lib/doleditor.class.php"); - $doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,158,'dolibarr_notes','In',false,true,$conf->fckeditor->enabled,ROWS_5,90); + $doleditor=new DolEditor('main_motd',$conf->global->MAIN_MOTD,142,'dolibarr_notes','In',false,true,true,ROWS_4,90); $doleditor->Create(); - print '

'."\n"; + + + // PDF + print_fiche_titre($langs->trans("PDF"),'','').'
'; + $var=true; + print ''; + print ''; + + // Show prof id 1 in address into pdf + $var=!$var; + print ''; + + // Show prof id 2 in address into pdf + $var=!$var; + print ''; + + // Show prof id 3 in address into pdf + $var=!$var; + print ''; + + // Show prof id 4 in address into pdf + $var=!$var; + print ''; + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId1",$mysoc->pays_code).''; + print $html->selectyesno('MAIN_PROFID1_IN_ADDRESS',isset($conf->global->MAIN_PROFID1_IN_ADDRESS)?$conf->global->MAIN_PROFID1_IN_ADDRESS:0,1); + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId2",$mysoc->pays_code).''; + print $html->selectyesno('MAIN_PROFID2_IN_ADDRESS',isset($conf->global->MAIN_PROFID2_IN_ADDRESS)?$conf->global->MAIN_PROFID2_IN_ADDRESS:0,1); + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId3",$mysoc->pays_code).''; + print $html->selectyesno('MAIN_PROFID3_IN_ADDRESS',isset($conf->global->MAIN_PROFID3_IN_ADDRESS)?$conf->global->MAIN_PROFID3_IN_ADDRESS:0,1); + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId4",$mysoc->pays_code).''; + print $html->selectyesno('MAIN_PROFID4_IN_ADDRESS',isset($conf->global->MAIN_PROFID4_IN_ADDRESS)?$conf->global->MAIN_PROFID4_IN_ADDRESS:0,1); + print '
'; + print '
'; print ''; print '
'; @@ -295,6 +336,8 @@ else // Show { $var=true; + // Language + print_fiche_titre($langs->trans("Language"),'','').'
'; print ''; print ''; @@ -314,8 +357,36 @@ else // Show print ''; print ""; + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").' 
 

'."\n"; + + + // Themes + show_theme('',0); + print '
'; + + + // Liste des zone de recherches permanentes supportees + print ''; + print ''; + $var=true; + foreach ($searchform as $key => $value) + { + $var=!$var; + print ''; + print ''; + } + print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); + print '
'; + print '
'; + + + // Other + $var=true; + print ''; + print ''; + $var=!$var; - print ''; + print ''; print ''; print ""; @@ -375,55 +446,29 @@ else // Show print ''; print ''; - print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("EnableShowLogo").'' . yn($conf->global->MAIN_SHOW_LOGO) . '
'.$langs->trans("EnableShowLogo").'' . yn($conf->global->MAIN_SHOW_LOGO) . ' 
 

'; - - - // Themes - show_theme('',0); - print '
'; - - - // Liste des zone de recherches permanentes supportees - print ''; - print ''; - $var=true; - foreach ($searchform as $key => $value) - { - $var=!$var; - print ''; - print ''; - } - print '
'.$langs->trans("PermanentLeftSearchForm").''.$langs->trans("Activated").' 
'.$searchformtitle[$key].''.yn($searchformconst[$key]).''.$langs->trans("IfModuleEnabled",$langs->transnoentitiesnoconv($searchformmodule[$key])); - print '
'; - print '
'; - - $var=true; - print ''; - print ''; - // Link to help center $var=!$var; - print ''; // Link to wiki help $var=!$var; - print ''; // Message login $var=!$var; - print ''; + print ''."\n"; // Message of the day $var=!$var; - print ''; + print ''."\n"; /* // Show bugtrack link @@ -434,8 +479,39 @@ else // Show print ""; */ + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("DisableLinkToHelpCenter").''; + print '
'.$langs->trans("DisableLinkToHelpCenter").''; print yn($conf->global->MAIN_HELPCENTER_DISABLELINK,1); print '
'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1)).''; + print '
'.$langs->trans("DisableLinkToHelp",img_picto('',DOL_URL_ROOT.'/theme/common/helpdoc.png','',1)).''; print yn($conf->global->MAIN_HELP_DISABLELINK,1); print '
'.$langs->trans("MessageLogin").''; + print '
'.$langs->trans("MessageLogin").''; print nl2br($conf->global->MAIN_HOME); - print '
'.$langs->trans("MessageOfDay").''; + print '
'.$langs->trans("MessageOfDay").''; print nl2br($conf->global->MAIN_MOTD); - print '

'."\n"; - print ''; + + $var=true; + //print_fiche_titre($langs->trans("PDF"),'','').'
'; + print ''; + print ''; + + // Show prof id 1 in address into pdf + $var=!$var; + print ''; + + // Show prof id 2 in address into pdf + $var=!$var; + print ''; + + // Show prof id 3 in address into pdf + $var=!$var; + print ''; + + // Show prof id 4 in address into pdf + $var=!$var; + print ''; + + print '
'.$langs->trans("Parameter").''.$langs->trans("Value").'
'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId1",$mysoc->pays_code).''; + print yn($conf->global->MAIN_PROFID1_IN_ADDRESS,1); + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId2",$mysoc->pays_code).''; + print yn($conf->global->MAIN_PROFID2_IN_ADDRESS,1); + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId3",$mysoc->pays_code).''; + print yn($conf->global->MAIN_PROFID3_IN_ADDRESS,1); + print '
'.$langs->trans("ShowProfIdInAddress").' - '.$langs->transcountry("ProfId4",$mysoc->pays_code).''; + print yn($conf->global->MAIN_PROFID4_IN_ADDRESS,1); + print '
'."\n"; print '
'; diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php index 7540a3ead16..f446dc31304 100644 --- a/htdocs/core/class/translate.class.php +++ b/htdocs/core/class/translate.class.php @@ -482,10 +482,10 @@ class Translate { /** - * \brief Retourne la version traduite du texte passe en parametre complete du code pays - * \param str string root to translate - * \param countrycode country code (FR, ...) - * \return string translated string + * Retourne la version traduite du texte passe en parametre complete du code pays + * @param str string root to translate + * @param countrycode country code (FR, ...) + * @return string translated string */ function transcountrynoentities($str, $countrycode) { diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index 4543711d63e..543abafe408 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -781,6 +781,7 @@ SimpleNumRefModelDesc=Return the reference number with format %syymm-nnnn where ListOfEntities=List of entities AddEntity=Add entity EditEntity=Edit entity +ShowProfIdInAddress=Show professionnal id into addresses on documents ##### Module password generation PasswordGenerationStandard=Return a password generated according to internal Dolibarr algorithm: 8 characters containing shared numbers and characters in lowercase. diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 8c59bb6fb20..da14bb6a114 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -792,6 +792,7 @@ SimpleNumRefModelDesc=Renvoie le numéro sous la forme %syymm-nnnn où yy est l' ListOfEntities=Liste des entités AddEntity=Ajouter entité EditEntity=Editer entité +ShowProfIdInAddress=Afficher l'identifiant professionnel dans les adresses sur les documents ##### Module password generation= undefined PasswordGenerationStandard= Renvoie un mot de passe généré selon algorithme interne Dolibarr: 8 caractères, chiffres et caractères en minuscules mélangés. diff --git a/htdocs/lib/doleditor.class.php b/htdocs/lib/doleditor.class.php index ea6c20864a8..401a513ba81 100644 --- a/htdocs/lib/doleditor.class.php +++ b/htdocs/lib/doleditor.class.php @@ -55,11 +55,11 @@ class DolEditor * 'Out:nom' partage de la barre d'outils ou 'nom' est le nom du DIV qui affiche la barre * @param toolbarstartexpanded visible ou non au demarrage * @param uselocalbrowser Enabled to add links to local object with local browsers. If false, only external images can be added in content. - * @param tool fckeditor or textarea or xxx + * @param okforextandededitor True=Allow usage of extended editor tool (like fckeditor) * @param rows Size of rows for textarea tool * @param cols Size of cols for textarea tool */ - function DolEditor($htmlname,$content,$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforfckeditor=true,$rows=0,$cols=0) + function DolEditor($htmlname,$content,$height=200,$toolbarname='Basic',$toolbarlocation='In',$toolbarstartexpanded=false,$uselocalbrowser=true,$okforextandededitor=true,$rows=0,$cols=0) { global $conf,$langs; @@ -68,7 +68,7 @@ class DolEditor $this->tool='fckeditor'; // By default // Check fckeditor is ok - if ($this->tool == 'fckeditor' && (empty($conf->fckeditor->enabled) || ! $okforfckeditor)) + if ($this->tool == 'fckeditor' && (empty($conf->fckeditor->enabled) || ! $okforextandededitor)) { $this->tool = 'textarea'; }