diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index b87c1b0c066..4c6fbb2045c 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -610,12 +610,23 @@ if (empty($reshook)) // Classify billed else if ($action == 'classifybilled' && $usercanclose) { + $db->begin(); + $result=$object->cloture($user, 4, ''); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } // Close proposal @@ -628,12 +639,23 @@ if (empty($reshook)) // prevent browser refresh from closing proposal several times if ($object->statut == Propal::STATUS_VALIDATED) { + $db->begin(); + $result=$object->cloture($user, GETPOST('statut','int'), GETPOST('note_private','none')); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } } } @@ -644,12 +666,23 @@ if (empty($reshook)) // prevent browser refresh from reopening proposal several times if ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED) { + $db->begin(); + $result=$object->reopen($user, 1); if ($result < 0) { setEventMessages($object->error, $object->errors, 'errors'); $error++; } + + if (! $error) + { + $db->commit(); + } + else + { + $db->rollback(); + } } } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 263a425ff01..efc968f3e06 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2467,16 +2467,16 @@ class Propal extends CommonObject if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) { - // Define output language - $outputlangs = $langs; - if (! empty($conf->global->MAIN_MULTILANGS)) - { - $outputlangs = new Translate("",$conf); - $newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang); - $outputlangs->setDefaultLang($newlang); - } - //$ret=$object->fetch($id); // Reload to get new records - $this->generateDocument($modelpdf, $outputlangs); + // Define output language + $outputlangs = $langs; + if (! empty($conf->global->MAIN_MULTILANGS)) + { + $outputlangs = new Translate("",$conf); + $newlang=(GETPOST('lang_id','aZ09') ? GETPOST('lang_id','aZ09') : $this->thirdparty->default_lang); + $outputlangs->setDefaultLang($newlang); + } + //$ret=$object->fetch($id); // Reload to get new records + $this->generateDocument($modelpdf, $outputlangs); } if (! $error) @@ -2484,7 +2484,7 @@ class Propal extends CommonObject $this->oldcopy= clone $this; $this->statut = $statut; $this->date_cloture = $now; - $this->note_private = $note; + $this->note_private = $newprivatenote; } if (! $notrigger && empty($error)) @@ -2495,13 +2495,17 @@ class Propal extends CommonObject // End call triggers } - if ( ! $error ) + if (! $error) { $this->db->commit(); return 1; } else { + $this->statut = $this->oldcopy->statut; + $this->date_cloture = $this->oldcopy->date_cloture; + $this->note_private = $this->oldcopy->note_private; + $this->db->rollback(); return -1; } @@ -3162,7 +3166,7 @@ class Propal extends CommonObject $this->labelstatut[3]=$langs->trans("PropalStatusNotSigned"); $this->labelstatut[4]=$langs->trans("PropalStatusBilled"); $this->labelstatut_short[0]=$langs->trans("PropalStatusDraftShort"); - $this->labelstatut_short[1]=$langs->trans("Opened"); + $this->labelstatut_short[1]=$langs->trans("PropalStatusValidatedShort"); $this->labelstatut_short[2]=$langs->trans("PropalStatusSignedShort"); $this->labelstatut_short[3]=$langs->trans("PropalStatusNotSignedShort"); $this->labelstatut_short[4]=$langs->trans("PropalStatusBilledShort"); diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php index ecb035caeb8..c3cf1634557 100644 --- a/htdocs/compta/paiement/cheque/index.php +++ b/htdocs/compta/paiement/cheque/index.php @@ -91,7 +91,7 @@ $max=10; $sql = "SELECT bc.rowid, bc.date_bordereau as db, bc.amount, bc.ref as ref,"; $sql.= " bc.statut, bc.nbcheque,"; -$sql.= " ba.ref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,"; +$sql.= " ba.ref as bref, ba.label, ba.rowid as bid, ba.number, ba.currency_code, ba.account_number, ba.fk_accountancy_journal,"; $sql.= " aj.code"; $sql.= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc, ".MAIN_DB_PREFIX."bank_account as ba"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_journal as aj ON aj.rowid = ba.fk_accountancy_journal"; @@ -120,7 +120,7 @@ if ($resql) $checkdepositstatic->statut=$objp->statut; $accountstatic->id=$objp->bid; - $accountstatic->ref=$objp->ref; + $accountstatic->ref=$objp->bref; $accountstatic->label=$objp->label; $accountstatic->number=$objp->number; $accountstatic->currency_code=$objp->currency_code; diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index 07f6849e7ec..7860010d5f1 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1881,11 +1881,16 @@ class ExtraFields if (empty($enabled)) continue; if (empty($perms)) continue; - if ($this->attributes[$object->table_element]['required'][$key] && empty($_POST["options_".$key])) // Check if empty without GETPOST, value can be alpha, int, array, etc... + if ($this->attributes[$object->table_element]['required'][$key]) // Value is required { - //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; - $nofillrequired++; - $error_field_required[] = $langs->transnoentitiesnoconv($value); + // Check if empty without using GETPOST, value can be alpha, int, array, etc... + if ((! is_array($_POST["options_".$key]) && empty($_POST["options_".$key]) && $_POST["options_".$key] != '0') + || (is_array($_POST["options_".$key]) && empty($_POST["options_".$key]))) + { + //print 'ccc'.$value.'-'.$this->attributes[$object->table_element]['required'][$key]; + $nofillrequired++; + $error_field_required[] = $langs->transnoentitiesnoconv($value); + } } if (in_array($key_type,array('date'))) diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index e4be098329c..eb0e5ee78da 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -3068,7 +3068,10 @@ class Form $obj = $this->db->fetch_object($resql); // Si traduction existe, on l'utilise, sinon on prend le libelle par defaut - $label=($langs->trans("DemandReasonType".$obj->code)!=("DemandReasonType".$obj->code)?$langs->trans("DemandReasonType".$obj->code):($obj->label!='-'?$obj->label:'')); + $label=($obj->label!='-'?$obj->label:''); + if ($langs->trans("DemandReasonType".$obj->code) != ("DemandReasonType".$obj->code)) $label = $langs->trans("DemandReasonType".$obj->code); // So translation key DemandReasonTypeSRC_XXX will work + if ($langs->trans($obj->code) != $obj->code) $label=$langs->trans($obj->code); // So translation key SRC_XXX will work + $tmparray[$obj->rowid]['id'] =$obj->rowid; $tmparray[$obj->rowid]['code'] =$obj->code; $tmparray[$obj->rowid]['label']=$label; @@ -3117,7 +3120,8 @@ class Form { print ''; } print ''; diff --git a/htdocs/core/menus/init_menu_auguria.sql b/htdocs/core/menus/init_menu_auguria.sql index 806960aaa34..afd7ba0ffcb 100644 --- a/htdocs/core/menus/init_menu_auguria.sql +++ b/htdocs/core/menus/init_menu_auguria.sql @@ -63,10 +63,16 @@ insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, left insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="admintools"', __HANDLER__, 'left', 320__+MAX_llx_menu__, 'home', '', 300__+MAX_llx_menu__, '/product/admin/product_tools.php?mainmenu=home&leftmenu=admintools', 'ProductVatMassChange', 1, 'products', '', '', 2, 15, __ENTITY__); -- Home - Menu users and groups insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '1', __HANDLER__, 'left', 400__+MAX_llx_menu__, 'home', 'users', 1__+MAX_llx_menu__, '/user/home.php?leftmenu=users', 'MenuUsersAndGroups', 0, 'users', '', '', 2, 4, __ENTITY__); + insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 401__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/list.php?leftmenu=users', 'Users', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 402__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/card.php?leftmenu=users&action=create', 'NewUser', 2, 'users', '($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 403__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/list.php?leftmenu=users', 'Groups', 1, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 1, __ENTITY__); -insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 403__+MAX_llx_menu__, '/user/group/card.php?leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); + +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 404__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/user/hierarchy.php?leftmenu=users', 'HierarchicView', 1, 'users', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 405__+MAX_llx_menu__, 'home', '', 401__+MAX_llx_menu__, '/categories/index.php?leftmenu=users&type=7', 'UsersCategoriesShort', 1, 'categories', '$user->rights->user->user->lire || $user->admin', '', 2, 0, __ENTITY__); + +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 407__+MAX_llx_menu__, 'home', '', 400__+MAX_llx_menu__, '/user/group/list.php?leftmenu=users', 'Groups', 1, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 1, __ENTITY__); +insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$leftmenu=="users"', __HANDLER__, 'left', 408__+MAX_llx_menu__, 'home', '', 407__+MAX_llx_menu__, '/user/group/card.php?leftmenu=users&action=create', 'NewGroup', 2, 'users', '(($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)', '', 2, 0, __ENTITY__); + -- Third parties insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 500__+MAX_llx_menu__, 'companies', 'thirdparties', 2__+MAX_llx_menu__, '/societe/index.php?leftmenu=thirdparties', 'ThirdParty', 0, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); insert into llx_menu (module, enabled, menu_handler, type, rowid, mainmenu, leftmenu, fk_menu, url, titre, level, langs, perms, target, usertype, position, entity) values ('', '$conf->societe->enabled', __HANDLER__, 'left', 501__+MAX_llx_menu__, 'companies', '', 500__+MAX_llx_menu__, '/societe/card.php?action=create', 'MenuNewThirdParty', 1, 'companies', '$user->rights->societe->lire', '', 2, 0, __ENTITY__); diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php index 3a7e6ae784b..e18977117ae 100644 --- a/htdocs/core/menus/standard/eldy.lib.php +++ b/htdocs/core/menus/standard/eldy.lib.php @@ -616,6 +616,11 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu $newmenu->add("/user/card.php?leftmenu=users&action=create", $langs->trans("NewUser"),2, ($user->rights->user->user->creer || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE), '', 'home'); $newmenu->add("/user/list.php?leftmenu=users", $langs->trans("ListOfUsers"), 2, $user->rights->user->user->lire || $user->admin); $newmenu->add("/user/hierarchy.php?leftmenu=users", $langs->trans("HierarchicView"), 2, $user->rights->user->user->lire || $user->admin); + if (! empty($conf->categorie->enabled)) + { + $langs->load("categories"); + $newmenu->add("/categories/index.php?leftmenu=users&type=7", $langs->trans("UsersCategoriesShort"), 2, $user->rights->categorie->lire, '', $mainmenu, 'cat'); + } $newmenu->add("", $langs->trans("Groups"), 1, ($user->rights->user->user->lire || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); $newmenu->add("/user/group/card.php?leftmenu=users&action=create", $langs->trans("NewGroup"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->write:$user->rights->user->user->creer) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); $newmenu->add("/user/group/list.php?leftmenu=users", $langs->trans("ListOfGroups"), 2, (($conf->global->MAIN_USE_ADVANCED_PERMS?$user->rights->user->group_advance->read:$user->rights->user->user->lire) || $user->admin) && !(! empty($conf->multicompany->enabled) && $conf->entity > 1 && $conf->global->MULTICOMPANY_TRANSVERSE_MODE)); diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index bbb42399db0..9d9abd92f4c 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1213,7 +1213,7 @@ WatermarkOnDraft=Watermark on draft document JSOnPaimentBill=Activate feature to autofill payment lines on payment form CompanyIdProfChecker=Rules for Professional IDs MustBeUnique=Must be unique? -MustBeMandatory=Mandatory to create third parties? +MustBeMandatory=Mandatory to create third parties (if vat number or type of company defined) ? MustBeInvoiceMandatory=Mandatory to validate invoices? TechnicalServicesProvided=Technical services provided #####DAV ##### diff --git a/htdocs/langs/en_US/categories.lang b/htdocs/langs/en_US/categories.lang index 47b5ea92d12..ee019d0ebbb 100644 --- a/htdocs/langs/en_US/categories.lang +++ b/htdocs/langs/en_US/categories.lang @@ -16,6 +16,7 @@ MembersCategoriesArea=Members tags/categories area ContactsCategoriesArea=Contacts tags/categories area AccountsCategoriesArea=Accounts tags/categories area ProjectsCategoriesArea=Projects tags/categories area +UsersCategoriesArea=Users tags/categories area SubCats=Sub-categories CatList=List of tags/categories NewCategory=New tag/category @@ -60,6 +61,7 @@ MembersCategoriesShort=Members tags/categories ContactCategoriesShort=Contacts tags/categories AccountsCategoriesShort=Accounts tags/categories ProjectsCategoriesShort=Projects tags/categories +UsersCategoriesShort=Users tags/categories ThisCategoryHasNoProduct=This category does not contain any product. ThisCategoryHasNoSupplier=This category does not contain any supplier. ThisCategoryHasNoCustomer=This category does not contain any customer. diff --git a/htdocs/langs/en_US/companies.lang b/htdocs/langs/en_US/companies.lang index 30a7ebbfddc..fbdd9685975 100644 --- a/htdocs/langs/en_US/companies.lang +++ b/htdocs/langs/en_US/companies.lang @@ -38,7 +38,7 @@ ThirdPartyCustomers=Customers ThirdPartyCustomersStats=Customers ThirdPartyCustomersWithIdProf12=Customers with %s or %s ThirdPartySuppliers=Vendors -ThirdPartyType=Third Party Type +ThirdPartyType=Type of company Individual=Private individual ToCreateContactWithSameName=Will create automatically a contact/address with same information as the third party under the third party. In most cases, even if your third party is a physical person, creating a third party alone is enough. ParentCompany=Parent company diff --git a/htdocs/langs/en_US/dict.lang b/htdocs/langs/en_US/dict.lang index 9a8ee71106b..0993d8bfb9a 100644 --- a/htdocs/langs/en_US/dict.lang +++ b/htdocs/langs/en_US/dict.lang @@ -295,7 +295,7 @@ CurrencyCentINR=paisa CurrencyCentSingINR=paise CurrencyThousandthSingTND=thousandth #### Input reasons ##### -DemandReasonTypeSRC_INTE=Internet +DemandReasonTypeSRC_INTE=Internetaaa DemandReasonTypeSRC_CAMP_MAIL=Mailing campaign DemandReasonTypeSRC_CAMP_EMAIL=EMailing campaign DemandReasonTypeSRC_CAMP_PHO=Phone campaign diff --git a/htdocs/langs/en_US/propal.lang b/htdocs/langs/en_US/propal.lang index 2d2f1bb2ff0..21ac0a0d503 100644 --- a/htdocs/langs/en_US/propal.lang +++ b/htdocs/langs/en_US/propal.lang @@ -33,7 +33,7 @@ PropalStatusSigned=Signed (needs billing) PropalStatusNotSigned=Not signed (closed) PropalStatusBilled=Billed PropalStatusDraftShort=Draft -PropalStatusValidatedShort=Validated +PropalStatusValidatedShort=Validated (open) PropalStatusClosedShort=Closed PropalStatusSignedShort=Signed PropalStatusNotSignedShort=Not signed diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 72bc5acd097..e81fbfcdbb8 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1208,7 +1208,7 @@ WatermarkOnDraft=Filigrane sur les documents brouillons JSOnPaimentBill=Activer la fonctionnalité de remplissage automatique des lignes de paiement sur le formulaire de paiement CompanyIdProfChecker=Règles sur les Identifiants professionnels MustBeUnique=Doit être unique ? -MustBeMandatory=Obligatoire pour créer des tiers ? +MustBeMandatory=Obligatoire pour créer des tiers (si num tva ou type de société défini) ? MustBeInvoiceMandatory=Obligatoire pour valider des factures ? TechnicalServicesProvided=Services techniques fournis #####DAV ##### diff --git a/htdocs/langs/fr_FR/companies.lang b/htdocs/langs/fr_FR/companies.lang index fbd8bb87e4e..548a7f6e0dd 100644 --- a/htdocs/langs/fr_FR/companies.lang +++ b/htdocs/langs/fr_FR/companies.lang @@ -38,7 +38,7 @@ ThirdPartyCustomers=Clients ThirdPartyCustomersStats=Clients ThirdPartyCustomersWithIdProf12=Clients avec %s ou %s ThirdPartySuppliers=Fournisseurs -ThirdPartyType=Type du tiers +ThirdPartyType=Type du société Individual=Individu privé ToCreateContactWithSameName=Crée automatiquement un contact/adresse, sous le tiers, avec la même information que le tiers. Dans la plupart des cas, même si votre tiers est une personne physique, la création d'un tiers seul suffit. ParentCompany=Maison mère diff --git a/htdocs/langs/fr_FR/propal.lang b/htdocs/langs/fr_FR/propal.lang index f35f63cf34d..a575824fc72 100644 --- a/htdocs/langs/fr_FR/propal.lang +++ b/htdocs/langs/fr_FR/propal.lang @@ -33,7 +33,7 @@ PropalStatusSigned=Signée (à facturer) PropalStatusNotSigned=Non signée (fermée) PropalStatusBilled=Facturée PropalStatusDraftShort=Brouillon -PropalStatusValidatedShort=Validé +PropalStatusValidatedShort=Validée (ouverte) PropalStatusClosedShort=Fermée PropalStatusSignedShort=Signée PropalStatusNotSignedShort=Non signée diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index a6dec311d0d..69f53547d32 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3150,8 +3150,12 @@ class Societe extends CommonObject // Define if third party is treated as company (or not) when nature is unknown $isacompany=empty($conf->global->MAIN_UNKNOWN_CUSTOMERS_ARE_COMPANIES)?0:1; // 0 by default if (! empty($this->tva_intra)) $isacompany=1; - else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_PRIVATE'))) $isacompany=0; - else if (! empty($this->typent_code) && in_array($this->typent_code,array('TE_SMALL','TE_MEDIUM','TE_LARGE','TE_GROUP'))) $isacompany=1; + else if (! empty($this->typent_code) && $this->typent_code != 'TE_UNKNOWN') + { + // TODO Add a field is_a_company into dictionary + if (preg_match('/^TE_PRIVATE/', $this->typent_code)) $isacompany=0; + else $isacompany=1; + } return $isacompany; } diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php index 3146f1095b0..7280fcc5c2a 100644 --- a/htdocs/user/agenda_extsites.php +++ b/htdocs/user/agenda_extsites.php @@ -157,7 +157,7 @@ dol_fiche_head($head, 'extsites', $langs->trans("User"), -1, 'user'); $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index 2820e9e4690..13b555b6d5c 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -194,7 +194,7 @@ if ($action != 'edit' && $action != 'create') // If not bank account yet, $acco $linkback = ''; if ($user->rights->user->user->lire || $user->admin) { - $linkback = ''.$langs->trans("BackToList").''; + $linkback = ''.$langs->trans("BackToList").''; } dol_banner_tab($object,'id',$linkback,$user->rights->user->user->lire || $user->admin); diff --git a/htdocs/user/card.php b/htdocs/user/card.php index dc2437af825..888550a6408 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -2285,7 +2285,7 @@ else { print '