Merge branch 'develop' of ssh://git@github.com/Dolibarr/dolibarr.git
into develop Conflicts: ChangeLog
This commit is contained in:
commit
ae4b871f04
@ -26,6 +26,8 @@ For users:
|
|||||||
For developers:
|
For developers:
|
||||||
- New: Add webservice to get or create a product, service.
|
- New: Add webservice to get or create a product, service.
|
||||||
- New: Add webservice to get a user.
|
- New: Add webservice to get a user.
|
||||||
|
- New: Add hooks to change way of showing/editing lines into dictionnaries.
|
||||||
|
- New: Add webservice to get or create a prodcut or service.
|
||||||
- New: Log module outputs can be setup with "or" rule (not only "xor").
|
- New: Log module outputs can be setup with "or" rule (not only "xor").
|
||||||
- New: Add FirePHP output for logging module.
|
- New: Add FirePHP output for logging module.
|
||||||
- Qual: Data structure for supplier prices is simpler.
|
- Qual: Data structure for supplier prices is simpler.
|
||||||
@ -112,6 +114,9 @@ For users:
|
|||||||
- Fix: Numbering module for invoices use same number for invoice
|
- Fix: Numbering module for invoices use same number for invoice
|
||||||
and credit note if mask is same.
|
and credit note if mask is same.
|
||||||
- Fix: Debug and clean withdraw module.
|
- Fix: Debug and clean withdraw module.
|
||||||
|
- Fix: Allow access permission for point of sale module.
|
||||||
|
- Fix: Permissions issues with suppliers.
|
||||||
|
- Fix: Admin dict data is showing with active language
|
||||||
|
|
||||||
For developers:
|
For developers:
|
||||||
- New: External modules can add tabs on agenda views.
|
- New: External modules can add tabs on agenda views.
|
||||||
|
|||||||
@ -5,6 +5,7 @@
|
|||||||
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
* Copyright (C) 2005-2010 Regis Houssin <regis@dolibarr.fr>
|
||||||
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
|
* Copyright (C) 2011 Remy Younes <ryounes@gmail.com>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -35,12 +36,12 @@ $langs->load("other");
|
|||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
$langs->load("companies");
|
$langs->load("companies");
|
||||||
|
|
||||||
|
$action=GETPOST('action')?GETPOST('action'):'view';
|
||||||
|
|
||||||
if (!$user->admin) accessforbidden();
|
if (!$user->admin) accessforbidden();
|
||||||
|
|
||||||
$acts[0] = "activate";
|
$acts[0] = "activate";
|
||||||
$acts[1] = "disable";
|
$acts[1] = "disable";
|
||||||
//$actl[0] = $langs->trans("Activate");
|
|
||||||
//$actl[1] = $langs->trans("Disable");
|
|
||||||
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
$actl[0] = img_picto($langs->trans("Disabled"),'switch_off');
|
||||||
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
$actl[1] = img_picto($langs->trans("Activated"),'switch_on');
|
||||||
|
|
||||||
@ -56,14 +57,18 @@ $offset = $listlimit * $page ;
|
|||||||
$pageprev = $page - 1;
|
$pageprev = $page - 1;
|
||||||
$pagenext = $page + 1;
|
$pagenext = $page + 1;
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
|
||||||
|
include_once(DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php');
|
||||||
|
$hookmanager=new HookManager($db);
|
||||||
|
$hookmanager->callHooks(array('admin'));
|
||||||
|
|
||||||
// Cette page est une page d'edition generique des dictionnaires de donnees
|
// Thi page is a generic page to edit dictionnaries
|
||||||
// Mettre ici tous les caracteristiques des dictionnaires
|
// Put here delacaration of dictionnaries properties
|
||||||
|
|
||||||
// Ordres d'affichage des dictionnaires (0 pour espace)
|
// Sort order to show dictionnary (0 is space). All other dictionnaries (added by modules) will be at end of this.
|
||||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,22,20,18,21,0,15);
|
$taborder=array(9,0,4,3,2,0,1,8,19,16,0,5,11,0,6,0,10,12,13,0,14,0,7,17,0,22,20,18,21,0,15);
|
||||||
|
|
||||||
// Nom des tables des dictionnaires
|
// Name of SQL tables of dictionnaries
|
||||||
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
|
$tabname[1] = MAIN_DB_PREFIX."c_forme_juridique";
|
||||||
$tabname[2] = MAIN_DB_PREFIX."c_departements";
|
$tabname[2] = MAIN_DB_PREFIX."c_departements";
|
||||||
$tabname[3] = MAIN_DB_PREFIX."c_regions";
|
$tabname[3] = MAIN_DB_PREFIX."c_regions";
|
||||||
@ -595,7 +600,7 @@ if ($_GET["id"])
|
|||||||
|
|
||||||
$fieldlist=explode(',',$tabfield[$_GET["id"]]);
|
$fieldlist=explode(',',$tabfield[$_GET["id"]]);
|
||||||
|
|
||||||
print '<form action="dict.php" method="post">';
|
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<table class="noborder" width="100%">';
|
print '<table class="noborder" width="100%">';
|
||||||
|
|
||||||
@ -615,6 +620,7 @@ if ($_GET["id"])
|
|||||||
// Determine le nom du champ par rapport aux noms possibles
|
// Determine le nom du champ par rapport aux noms possibles
|
||||||
// dans les dictionnaires de donnees
|
// dans les dictionnaires de donnees
|
||||||
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
||||||
|
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||||
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
|
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
|
||||||
@ -664,7 +670,12 @@ if ($_GET["id"])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldList($fieldlist,$obj);
|
$tmpaction = 'create';
|
||||||
|
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$_GET["id"]]);
|
||||||
|
$reshook=$hookmanager->executeHooks('createDictionaryFieldlist',$parameters, $obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
|
if (empty($reshook)) fieldList($fieldlist,$obj);
|
||||||
|
|
||||||
print '<td colspan="3" align="right"><input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'"></td>';
|
print '<td colspan="3" align="right"><input type="submit" class="button" name="actionadd" value="'.$langs->trans("Add").'"></td>';
|
||||||
print "</tr>";
|
print "</tr>";
|
||||||
@ -703,6 +714,7 @@ if ($_GET["id"])
|
|||||||
// dans les dictionnaires de donnees
|
// dans les dictionnaires de donnees
|
||||||
$showfield=1; // Par defaut
|
$showfield=1; // Par defaut
|
||||||
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
$valuetoshow=ucfirst($fieldlist[$field]); // Par defaut
|
||||||
|
$valuetoshow=$langs->trans($valuetoshow); // try to translate
|
||||||
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
if ($fieldlist[$field]=='source') { $valuetoshow=$langs->trans("Contact"); }
|
||||||
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
if ($fieldlist[$field]=='price') { $valuetoshow=$langs->trans("PriceUHT"); }
|
||||||
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
|
if ($fieldlist[$field]=='taux') { $valuetoshow=$langs->trans("Rate"); }
|
||||||
@ -739,113 +751,127 @@ if ($_GET["id"])
|
|||||||
$var=!$var;
|
$var=!$var;
|
||||||
//print_r($obj);
|
//print_r($obj);
|
||||||
print "<tr ".$bc[$var].">";
|
print "<tr ".$bc[$var].">";
|
||||||
if ($_GET["action"] == 'modify' && ($_GET["rowid"] == ($obj->rowid?$obj->rowid:$obj->code)))
|
|
||||||
|
if ($action == 'edit' && ($_GET["rowid"] == ($obj->rowid?$obj->rowid:$obj->code)))
|
||||||
{
|
{
|
||||||
print '<form action="dict.php" method="post">';
|
print '<form action="dict.php" method="post">';
|
||||||
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
|
||||||
print '<input type="hidden" name="id" value="'.GETPOST("id").'">';
|
print '<input type="hidden" name="id" value="'.GETPOST("id").'">';
|
||||||
print '<input type="hidden" name="page" value="'.$page.'">';
|
print '<input type="hidden" name="page" value="'.$page.'">';
|
||||||
print '<input type="hidden" name="rowid" value="'.$_GET["rowid"].'">';
|
print '<input type="hidden" name="rowid" value="'.$_GET["rowid"].'">';
|
||||||
fieldList($fieldlist,$obj);
|
|
||||||
|
$tmpaction='edit';
|
||||||
|
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$_GET["id"]]);
|
||||||
|
$reshook=$hookmanager->executeHooks('editDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
|
if (empty($reshook)) fieldList($fieldlist,$obj);
|
||||||
|
|
||||||
print '<td colspan="3" align="right"><a name="'.($obj->rowid?$obj->rowid:$obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
print '<td colspan="3" align="right"><a name="'.($obj->rowid?$obj->rowid:$obj->code).'"> </a><input type="submit" class="button" name="actionmodify" value="'.$langs->trans("Modify").'">';
|
||||||
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
print ' <input type="submit" class="button" name="actioncancel" value="'.$langs->trans("Cancel").'"></td>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
foreach ($fieldlist as $field => $value)
|
$tmpaction = 'view';
|
||||||
|
$parameters=array('fieldlist'=>$fieldlist, 'tabname'=>$tabname[$_GET["id"]]);
|
||||||
|
$reshook=$hookmanager->executeHooks('viewDictionaryFieldlist',$parameters,$obj, $tmpaction); // Note that $action and $object may have been modified by some hooks
|
||||||
|
|
||||||
|
$error=$hookmanager->error; $errors=$hookmanager->errors;
|
||||||
|
|
||||||
|
if (empty($reshook))
|
||||||
{
|
{
|
||||||
$showfield=1;
|
foreach ($fieldlist as $field => $value)
|
||||||
$valuetoshow=$obj->$fieldlist[$field];
|
{
|
||||||
if ($valuetoshow=='all') {
|
$showfield=1;
|
||||||
$valuetoshow=$langs->trans('All');
|
$valuetoshow=$obj->$fieldlist[$field];
|
||||||
}
|
if ($valuetoshow=='all') {
|
||||||
else if ($fieldlist[$field]=='pays') {
|
$valuetoshow=$langs->trans('All');
|
||||||
if (empty($obj->pays_code))
|
|
||||||
{
|
|
||||||
$valuetoshow='-';
|
|
||||||
}
|
}
|
||||||
else
|
else if ($fieldlist[$field]=='pays') {
|
||||||
{
|
if (empty($obj->pays_code))
|
||||||
$key=$langs->trans("Country".strtoupper($obj->pays_code));
|
{
|
||||||
$valuetoshow=($key != "Country".strtoupper($obj->pays_code))?$obj->pays_code." - ".$key:$obj->pays;
|
$valuetoshow='-';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$key=$langs->trans("Country".strtoupper($obj->pays_code));
|
||||||
|
$valuetoshow=($key != "Country".strtoupper($obj->pays_code))?$obj->pays_code." - ".$key:$obj->pays;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm') {
|
||||||
|
$valuetoshow=yn($valuetoshow);
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='price') {
|
||||||
|
$valuetoshow=price($valuetoshow);
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle_facture') {
|
||||||
|
$langs->load("bills");
|
||||||
|
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
$valuetoshow=nl2br($valuetoshow);
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_pays') {
|
||||||
|
$key=$langs->trans("Country".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_availability') {
|
||||||
|
$langs->load("propal");
|
||||||
|
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_actioncomm') {
|
||||||
|
$key=$langs->trans("Action".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_currencies') {
|
||||||
|
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
|
||||||
|
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_typent') {
|
||||||
|
$key=$langs->trans(strtoupper($obj->code));
|
||||||
|
$valuetoshow=($key != strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_prospectlevel') {
|
||||||
|
$key=$langs->trans(strtoupper($obj->code));
|
||||||
|
$valuetoshow=($key != strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_civilite') {
|
||||||
|
$key=$langs->trans("Civility".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_type_contact') {
|
||||||
|
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_payment_term') {
|
||||||
|
$langs->load("bills");
|
||||||
|
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_paiement') {
|
||||||
|
$langs->load("bills");
|
||||||
|
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_input_reason') {
|
||||||
|
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_input_method') {
|
||||||
|
$langs->load("orders");
|
||||||
|
$key=$langs->trans($obj->code);
|
||||||
|
$valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
||||||
|
$langs->load("sendings");
|
||||||
|
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
|
||||||
|
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
||||||
|
}
|
||||||
|
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
|
||||||
|
$showfield=0;
|
||||||
|
}
|
||||||
|
if ($showfield) print '<td>'.$valuetoshow.'</td>';
|
||||||
}
|
}
|
||||||
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm') {
|
|
||||||
$valuetoshow=yn($valuetoshow);
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='price') {
|
|
||||||
$valuetoshow=price($valuetoshow);
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='price') {
|
|
||||||
$valuetoshow=price($valuetoshow);
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle_facture') {
|
|
||||||
$langs->load("bills");
|
|
||||||
$key=$langs->trans("PaymentCondition".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "PaymentCondition".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
$valuetoshow=nl2br($valuetoshow);
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_pays') {
|
|
||||||
$key=$langs->trans("Country".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "Country".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_availability') {
|
|
||||||
$langs->load("propal");
|
|
||||||
$key=$langs->trans("AvailabilityType".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "AvailabilityType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_actioncomm') {
|
|
||||||
$key=$langs->trans("Action".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "Action".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_currencies') {
|
|
||||||
$key=$langs->trans("Currency".strtoupper($obj->code_iso));
|
|
||||||
$valuetoshow=($obj->code_iso && $key != "Currency".strtoupper($obj->code_iso))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_typent') {
|
|
||||||
$key=$langs->trans(strtoupper($obj->code));
|
|
||||||
$valuetoshow=($key != strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_prospectlevel') {
|
|
||||||
$key=$langs->trans(strtoupper($obj->code));
|
|
||||||
$valuetoshow=($key != strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_civilite') {
|
|
||||||
$key=$langs->trans("Civility".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "Civility".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_type_contact') {
|
|
||||||
$key=$langs->trans("TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "TypeContact_".$obj->element."_".$obj->source."_".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_payment_term') {
|
|
||||||
$langs->load("bills");
|
|
||||||
$key=$langs->trans("PaymentConditionShort".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "PaymentConditionShort".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_paiement') {
|
|
||||||
$langs->load("bills");
|
|
||||||
$key=$langs->trans("PaymentType".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "PaymentType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='label' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_input_reason') {
|
|
||||||
$key=$langs->trans("DemandReasonType".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "DemandReasonType".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_input_method') {
|
|
||||||
$langs->load("orders");
|
|
||||||
$key=$langs->trans($obj->code);
|
|
||||||
$valuetoshow=($obj->code && $key != $obj->code)?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='libelle' && $tabname[$_GET["id"]]==MAIN_DB_PREFIX.'c_shipment_mode') {
|
|
||||||
$langs->load("sendings");
|
|
||||||
$key=$langs->trans("SendingMethod".strtoupper($obj->code));
|
|
||||||
$valuetoshow=($obj->code && $key != "SendingMethod".strtoupper($obj->code))?$key:$obj->$fieldlist[$field];
|
|
||||||
}
|
|
||||||
else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
|
|
||||||
$showfield=0;
|
|
||||||
}
|
|
||||||
if ($showfield) print '<td>'.$valuetoshow.'</td>';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<td align="center" nowrap="nowrap">';
|
print '<td align="center" nowrap="nowrap">';
|
||||||
@ -856,25 +882,18 @@ if ($_GET["id"])
|
|||||||
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
|
if (isset($obj->code) && $obj->code == 'EF0') $iserasable=0;
|
||||||
if ($obj->type && $obj->type == 'system') $iserasable=0;
|
if ($obj->type && $obj->type == 'system') $iserasable=0;
|
||||||
|
|
||||||
if ($iserasable) {
|
if ($iserasable) print '<a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&code='.$obj->code.'&id='.$_GET["id"].'&action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&code='.$obj->code.'&id='.$_GET["id"].'&action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
else print $langs->trans("AlwaysActive");
|
||||||
} else {
|
|
||||||
print $langs->trans("AlwaysActive");
|
|
||||||
}
|
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Modify link
|
// Modify link
|
||||||
if ($iserasable) {
|
if ($iserasable) print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&code='.$obj->code.'&id='.$_GET["id"].'&action=edit#'.($obj->rowid?$obj->rowid:$obj->code).'">'.img_edit().'</a></td>';
|
||||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&code='.$obj->code.'&id='.$_GET["id"].'&action=modify#'.($obj->rowid?$obj->rowid:$obj->code).'">'.img_edit().'</a></td>';
|
else print '<td> </td>';
|
||||||
} else {
|
|
||||||
print '<td> </td>';
|
|
||||||
}
|
|
||||||
// Delete link
|
// Delete link
|
||||||
if ($iserasable) {
|
if ($iserasable) print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&code='.$obj->code.'&id='.$_GET["id"].'&action=delete">'.img_delete().'</a></td>';
|
||||||
print '<td align="center"><a href="'.$_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.($obj->rowid?$obj->rowid:$obj->code).'&code='.$obj->code.'&id='.$_GET["id"].'&action=delete">'.img_delete().'</a></td>';
|
else print '<td> </td>';
|
||||||
} else {
|
|
||||||
print '<td> </td>';
|
|
||||||
}
|
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
}
|
}
|
||||||
$i++;
|
$i++;
|
||||||
@ -915,7 +934,7 @@ else
|
|||||||
print '<tr '.$bc[$var].'><td width="30%">';
|
print '<tr '.$bc[$var].'><td width="30%">';
|
||||||
if (! empty($tabcond[$i]))
|
if (! empty($tabcond[$i]))
|
||||||
{
|
{
|
||||||
print '<a href="dict.php?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
|
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -970,11 +989,10 @@ function fieldList($fieldlist,$obj='')
|
|||||||
|
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
{
|
{
|
||||||
|
if ($fieldlist[$field] == 'pays') {
|
||||||
if ($fieldlist[$field] == 'pays') {
|
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
||||||
if (in_array('region_id',$fieldlist)) { print '<td> </td>'; continue; } // For region page, we do not show the country input
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$html->select_pays($obj->pays,'pays');
|
print $html->select_country(($obj->pays_code?$obj->pays_code:$obj->pays),'pays');
|
||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
elseif ($fieldlist[$field] == 'pays_id') {
|
elseif ($fieldlist[$field] == 'pays_id') {
|
||||||
|
|||||||
@ -293,7 +293,7 @@ class Form
|
|||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
$countryArray[$i]['rowid'] = $obj->rowid;
|
$countryArray[$i]['rowid'] = $obj->rowid;
|
||||||
$countryArray[$i]['code_iso'] = $obj->code_iso;
|
$countryArray[$i]['code_iso'] = $obj->code_iso;
|
||||||
$countryArray[$i]['label'] = ($obj->code_iso && $langs->trans("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->trans("Country".$obj->code_iso):($obj->label!='-'?$obj->label:''));
|
$countryArray[$i]['label'] = ($obj->code_iso && $langs->transnoentitiesnoconv("Country".$obj->code_iso)!="Country".$obj->code_iso?$langs->transnoentitiesnoconv("Country".$obj->code_iso):($obj->label!='-'?$obj->label:''));
|
||||||
$label[$i] = $countryArray[$i]['label'];
|
$label[$i] = $countryArray[$i]['label'];
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
@ -302,10 +302,14 @@ class Form
|
|||||||
|
|
||||||
foreach ($countryArray as $row)
|
foreach ($countryArray as $row)
|
||||||
{
|
{
|
||||||
if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['label']) ) {
|
//print 'rr'.$selected.'-'.$row['label'].'-'.$row['code_iso'].'<br>';
|
||||||
$foundselected=true;
|
if ($selected && $selected != '-1' && ($selected == $row['rowid'] || $selected == $row['code_iso'] || $selected == $row['label']) )
|
||||||
|
{
|
||||||
|
$foundselected=true;
|
||||||
$out.= '<option value="'.$row['rowid'].'" selected="selected">';
|
$out.= '<option value="'.$row['rowid'].'" selected="selected">';
|
||||||
} else {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
$out.= '<option value="'.$row['rowid'].'">';
|
$out.= '<option value="'.$row['rowid'].'">';
|
||||||
}
|
}
|
||||||
$out.= $row['label'];
|
$out.= $row['label'];
|
||||||
|
|||||||
@ -881,6 +881,15 @@ function complete_dictionnary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsq
|
|||||||
|
|
||||||
if ($modulequalified)
|
if ($modulequalified)
|
||||||
{
|
{
|
||||||
|
// Load languages files of module
|
||||||
|
if (isset($objMod->langfiles) && is_array($objMod->langfiles))
|
||||||
|
{
|
||||||
|
foreach($objMod->langfiles as $langfile)
|
||||||
|
{
|
||||||
|
$langs->load($langfile);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$modules[$i] = $objMod;
|
$modules[$i] = $objMod;
|
||||||
$filename[$i]= $modName;
|
$filename[$i]= $modName;
|
||||||
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
|
$orders[$i] = $objMod->family."_".$j; // Tri par famille puis numero module
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user