Merge branch 'develop' into develop_merger_cust_prospect_tab

This commit is contained in:
fhenry 2013-02-12 19:18:15 +01:00
commit 136dc651f3
20 changed files with 231 additions and 195 deletions

View File

@ -183,7 +183,7 @@ if ($action == 'add_action')
if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1; if (! empty($conf->phenix->enabled) && GETPOST('add_phenix') == 'on') $actioncomm->use_phenix=1;
// Check parameters // Check parameters
if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || $datef == '')) if ($actioncomm->type_code == 'AC_RDV' && ($datep == '' || ($datef == '' && empty($fulldayevent))))
{ {
$error++; $error++;
$action = 'create'; $action = 'create';

View File

@ -2151,12 +2151,11 @@ else
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"]; $liste=array();
$formmail->withtosocid=$soc->id; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withtocc=1; $formmail->withto=GETPOST("sendto")?GETPOST("sendto"):$liste;
$formmail->withtoccsocid=0; $formmail->withtocc=$liste;
$formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false);
$formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__'); $formmail->withtopic=$langs->trans('SendPropalRef','__PROPREF__');
$formmail->withfile=2; $formmail->withfile=2;
$formmail->withbody=1; $formmail->withbody=1;

View File

@ -2418,12 +2418,11 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->withto=GETPOST('sendto')?GETPOST('sendto'):1; $liste=array();
$formmail->withtosocid=$soc->id; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withtocc=1; $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste;
$formmail->withtoccsocid=0; $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
$formmail->withfile=2; $formmail->withfile=2;
$formmail->withbody=1; $formmail->withbody=1;

View File

@ -3403,12 +3403,11 @@ else if ($id > 0 || ! empty($ref))
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"]; $liste=array();
$formmail->withtosocid=$soc->id; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withtocc=1; $formmail->withto=GETPOST('sendto')?GETPOST('sendto'):$liste;
$formmail->withtoccsocid=0; $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withtocccsocid=0;
$formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__'); $formmail->withtopic=$langs->transnoentities($topicmail,'__FACREF__');
$formmail->withfile=2; $formmail->withfile=2;
$formmail->withbody=1; $formmail->withbody=1;

View File

@ -823,11 +823,13 @@ class Form
* @param string $showfunction Add function into label * @param string $showfunction Add function into label
* @param string $moreclass Add more class to class style * @param string $moreclass Add more class to class style
* @param string $showsoc Add company into label * @param string $showsoc Add company into label
* @param int $forcecombo Force to use combo box
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @return int <0 if KO, Nb of contact in list if OK * @return int <0 if KO, Nb of contact in list if OK
*/ */
function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0) function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $event=array())
{ {
print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $showsoc); print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $showsoc, $forcecombo, $event);
return $this->num; return $this->num;
} }
@ -844,9 +846,11 @@ class Form
* @param string $moreclass Add more class to class style * @param string $moreclass Add more class to class style
* @param bool $options_only Return options only (for ajax treatment) * @param bool $options_only Return options only (for ajax treatment)
* @param string $showsoc Add company into label * @param string $showsoc Add company into label
* @param int $forcecombo Force to use combo box
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
* @return int <0 if KO, Nb of contact in list if OK * @return int <0 if KO, Nb of contact in list if OK
*/ */
function selectcontacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $options_only=false, $showsoc=0) function selectcontacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $options_only=false, $showsoc=0, $forcecombo=0, $event=array())
{ {
global $conf,$langs; global $conf,$langs;
@ -873,6 +877,11 @@ class Form
{ {
$num=$this->db->num_rows($resql); $num=$this->db->num_rows($resql);
if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $forcecombo)
{
$out.= ajax_combobox($htmlname, $event);
}
if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlname.'" name="'.$htmlname.'">'; if ($htmlname != 'none' || $options_only) $out.= '<select class="flat'.($moreclass?' '.$moreclass:'').'" id="'.$htmlname.'" name="'.$htmlname.'">';
if ($showempty == 1) $out.= '<option value="0"'.($selected=='0'?' selected="selected"':'').'></option>'; if ($showempty == 1) $out.= '<option value="0"'.($selected=='0'?' selected="selected"':'').'></option>';
if ($showempty == 2) $out.= '<option value="0"'.($selected=='0'?' selected="selected"':'').'>'.$langs->trans("Internal").'</option>'; if ($showempty == 2) $out.= '<option value="0"'.($selected=='0'?' selected="selected"':'').'>'.$langs->trans("Internal").'</option>';

View File

@ -49,6 +49,7 @@ class FormMail
var $withto; var $withto;
var $withtofree; var $withtofree;
var $withtocc; var $withtocc;
var $withtoccc;
var $withtopic; var $withtopic;
var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files var $withfile; // 0=No attaches files, 1=Show attached files, 2=Can add new attached files
var $withbody; var $withbody;
@ -428,23 +429,11 @@ class FormMail
else else
{ {
$out.= '<input size="'.(is_array($this->withtocc)?"30":"60").'" id="sendtocc" name="sendtocc" value="'.((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />'; $out.= '<input size="'.(is_array($this->withtocc)?"30":"60").'" id="sendtocc" name="sendtocc" value="'.((! is_array($this->withtocc) && ! is_numeric($this->withtocc))? (isset($_POST["sendtocc"])?$_POST["sendtocc"]:$this->withtocc) : (isset($_POST["sendtocc"])?$_POST["sendtocc"]:"") ).'" />';
if (! empty($this->withto) && is_array($this->withto)) if (! empty($this->withtocc) && is_array($this->withtocc))
{ {
$out.= " ".$langs->trans("or")." "; $out.= " ".$langs->trans("or")." ";
$out.= $form->selectarray("receivercc", $this->withto, GETPOST("receivercc"), 1); $out.= $form->selectarray("receivercc", $this->withto, GETPOST("receivercc"), 1);
} }
if (! empty($this->withtoccsocid) && $this->withtoccsocid > 0) // deprecated. TODO Remove this. Instead, fill withto with array before calling method.
{
$liste=array();
$soc=new Societe($this->db);
$soc->fetch($this->withtoccsocid);
foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
{
$liste[$key]=$value;
}
$out.= " ".$langs->trans("or")." ";
$out.= $form->selectarray("receivercc", $liste, GETPOST("receivercc"), 1);
}
} }
$out.= "</td></tr>\n"; $out.= "</td></tr>\n";
} }
@ -462,23 +451,11 @@ class FormMail
else else
{ {
$out.= '<input size="'.(is_array($this->withtoccc)?"30":"60").'" id="sendtoccc" name="sendtoccc" value="'.((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />'; $out.= '<input size="'.(is_array($this->withtoccc)?"30":"60").'" id="sendtoccc" name="sendtoccc" value="'.((! is_array($this->withtoccc) && ! is_numeric($this->withtoccc))? (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:$this->withtoccc) : (isset($_POST["sendtoccc"])?$_POST["sendtoccc"]:"") ).'" />';
if (! empty($this->withto) && is_array($this->withto)) if (! empty($this->withtoccc) && is_array($this->withtoccc))
{ {
$out.= " ".$langs->trans("or")." "; $out.= " ".$langs->trans("or")." ";
$out.= $form->selectarray("receiverccc", $this->withto, GETPOST("receiverccc"), 1); $out.= $form->selectarray("receiverccc", $this->withto, GETPOST("receiverccc"), 1);
} }
if (! empty($this->withtocccsocid) && $this->withtocccsocid > 0) // deprecated. TODO Remove this. Instead, fill withto with array before calling method.
{
$liste=array();
$soc=new Societe($this->db);
$soc->fetch($this->withtosocid);
foreach ($soc->thirdparty_and_contact_email_array(1) as $key=>$value)
{
$liste[$key]=$value;
}
$out.= " ".$langs->trans("or")." ";
$out.= $form->selectarray("receiverccc", $liste, GETPOST("receiverccc"), 1);
}
} }
//if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1); //if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1);
$out.= "</td></tr>\n"; $out.= "</td></tr>\n";

View File

@ -1443,12 +1443,11 @@ else
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->withto=GETPOST('sendto','int')?GETPOST('sendto','int'):1; $liste=array();
$formmail->withtosocid=$soc->id; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withtocc=1; $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
$formmail->withtoccsocid=0; $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendShippingRef','__SHIPPINGREF__'); $formmail->withtopic=$langs->trans('SendShippingRef','__SHIPPINGREF__');
$formmail->withfile=2; $formmail->withfile=2;
$formmail->withbody=1; $formmail->withbody=1;

View File

@ -1487,12 +1487,11 @@ else if ($id > 0 || ! empty($ref))
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->withto=(!GETPOST('sendto','alpha'))?1:GETPOST('sendto','alpha'); $liste=array();
$formmail->withtosocid=$societe->id; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withtocc=1; $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
$formmail->withtoccsocid=0; $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendInterventionRef','__FICHINTERREF__'); $formmail->withtopic=$langs->trans('SendInterventionRef','__FICHINTERREF__');
$formmail->withfile=2; $formmail->withfile=2;
$formmail->withbody=1; $formmail->withbody=1;

View File

@ -1819,12 +1819,11 @@ if (! empty($object->id))
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"]; $liste=array();
$formmail->withtosocid=$object->thirdparty->id; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withtocc=1; $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
$formmail->withtoccsocid=0; $formmail->withtocc=$liste;
$formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false); $formmail->withtoccc=(! empty($conf->global->MAIN_EMAIL_USECCC)?$conf->global->MAIN_EMAIL_USECCC:false);
$formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__'); $formmail->withtopic=$langs->trans('SendOrderRef','__ORDERREF__');
$formmail->withfile=2; $formmail->withfile=2;
$formmail->withbody=1; $formmail->withbody=1;

View File

@ -2075,12 +2075,11 @@ else
$formmail->fromname = $user->getFullName($langs); $formmail->fromname = $user->getFullName($langs);
$formmail->frommail = $user->email; $formmail->frommail = $user->email;
$formmail->withfrom=1; $formmail->withfrom=1;
$formmail->withto=empty($_POST["sendto"])?1:$_POST["sendto"]; $liste=array();
$formmail->withtosocid=$societe->id; foreach ($object->thirdparty->thirdparty_and_contact_email_array(1) as $key=>$value) $liste[$key]=$value;
$formmail->withtocc=1; $formmail->withto=GETPOST("sendto")?GETOST("sendto"):$liste;
$formmail->withtoccsocid=0; $formmail->withtocc=$liste;
$formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC; $formmail->withtoccc=$conf->global->MAIN_EMAIL_USECCC;
$formmail->withtocccsocid=0;
$formmail->withtopic=$langs->trans('SendBillRef','__FACREF__'); $formmail->withtopic=$langs->trans('SendBillRef','__FACREF__');
$formmail->withfile=2; $formmail->withfile=2;
$formmail->withbody=1; $formmail->withbody=1;

View File

@ -72,16 +72,24 @@ class Holiday extends CommonObject
function __construct($db) function __construct($db)
{ {
$this->db = $db; $this->db = $db;
// Mets à jour les congés payés en début de mois
$this->updateSoldeCP();
// Vérifie le nombre d'utilisateur et mets à jour si besoin
$this->verifNbUsers($this->countActiveUsers(),$this->getConfCP('nbUser'));
return 1;
} }
/**
* updateSold
*
* @return int Return 1
*/
function updateSold()
{
// Mets à jour les congés payés en début de mois
$this->updateSoldeCP();
// Vérifie le nombre d'utilisateur et mets à jour si besoin
$this->verifNbUsers($this->countActiveUsers(),$this->getConfCP('nbUser'));
return 1;
}
/** /**
* Créer un congés payés dans la base de données * Créer un congés payés dans la base de données
* *
@ -641,6 +649,7 @@ class Holiday extends CommonObject
if ($withpicto && $withpicto != 2) $result.=' '; if ($withpicto && $withpicto != 2) $result.=' ';
if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin; if ($withpicto != 2) $result.=$lien.$this->ref.$lienfin;
return $result; return $result;
} }
@ -861,15 +870,17 @@ class Holiday extends CommonObject
// Mois actuel // Mois actuel
$month = date('m',$now); $month = date('m',$now);
$lastUpdate = $this->getConfCP('lastUpdate'); $lastUpdate = $this->getConfCP('lastUpdate');
$monthLastUpdate = date('m', $lastUpdate); $monthLastUpdate = $lastUpdate[4].$lastUpdate[5];
//print 'month: '.$month.' '.$lastUpdate.' '.$monthLastUpdate;
// Si la date du mois n'est pas la même que celle sauvegardée, on met à jour le timestamp // Si la date du mois n'est pas la même que celle sauvegardée, on met à jour le timestamp
if ($month != $monthLastUpdate) if ($month != $monthLastUpdate)
{ {
$sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET"; $sql = "UPDATE ".MAIN_DB_PREFIX."holiday_config SET";
$sql.= " value = '".$this->db->idate($now)."'"; $sql.= " value = '".dol_print_date($now,'%Y%m%d%H%M%S')."'";
$sql.= " WHERE name = 'lastUpdate'"; $sql.= " WHERE name = 'lastUpdate'";
dol_syslog(get_class($this).'::updateSoldeCP sql='.$sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
// On ajoute x jours à chaque utilisateurs // On ajoute x jours à chaque utilisateurs

View File

@ -50,7 +50,7 @@ $sql.= " WHERE name = 'userGroup'";
$result = $db->query($sql); $result = $db->query($sql);
$obj = $db->fetch_object($result); $obj = $db->fetch_object($result);
if ($obj->value == null) if ($obj->value == null || $obj->value < 0)
{ {
llxHeader('',$langs->trans('CPTitreMenu')); llxHeader('',$langs->trans('CPTitreMenu'));

View File

@ -73,6 +73,9 @@ $search_statut = GETPOST('select_statut');
$holiday = new Holiday($db); $holiday = new Holiday($db);
$holidaystatic=new Holiday($db); $holidaystatic=new Holiday($db);
// Update sold
$holiday->updateSold();
$max_year = 5; $max_year = 5;
$min_year = 10; $min_year = 10;
$filter=''; $filter='';

View File

@ -50,6 +50,7 @@ DisableJavascript=Disable JavaScript and Ajax functions
ConfirmAjax=Use Ajax confirmation popups ConfirmAjax=Use Ajax confirmation popups
UseSearchToSelectCompany=Use autocompletion fields to choose third parties (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant SOCIETE_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string. UseSearchToSelectCompany=Use autocompletion fields to choose third parties (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant SOCIETE_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
ActivityStateToSelectCompany= Add a filter option to show/hide thirdparties which are currently in activity or has ceased it ActivityStateToSelectCompany= Add a filter option to show/hide thirdparties which are currently in activity or has ceased it
UseSearchToSelectContact=Use autocompletion fields to choose contact (instead of using a list box).<br><br>Also if you have a large number of third parties (> 100 000), you can increase speed by setting constant CONTACT_DONOTSEARCH_ANYWHERE to 1 in Setup->Other. Search will then be limited to start of string.
SearchFilter=Search filters options SearchFilter=Search filters options
NumberOfKeyToSearch=Nbr of characters to trigger search: %s NumberOfKeyToSearch=Nbr of characters to trigger search: %s
ViewFullDateActions=Show full dates events in the third sheet ViewFullDateActions=Show full dates events in the third sheet

View File

@ -15,7 +15,7 @@ MyEvents=My events
OtherEvents=Other events OtherEvents=Other events
ListOfActions=List of events ListOfActions=List of events
Location=Location Location=Location
EventOnFullDay=Event on full day EventOnFullDay=Event on all day(s)
SearchAnAction= Search an event/task SearchAnAction= Search an event/task
MenuToDoActions= All incomplete events MenuToDoActions= All incomplete events
MenuDoneActions= All terminated events MenuDoneActions= All terminated events

View File

@ -85,7 +85,7 @@ CountryDM=Dominica
CountryDO=República Dominicana CountryDO=República Dominicana
CountryEC=Ecuador CountryEC=Ecuador
CountryEG=Egipto CountryEG=Egipto
CountrySV=Salvador CountrySV=El Salvador
CountryGQ=Guinea Ecuatorial CountryGQ=Guinea Ecuatorial
CountryER=Eritrea CountryER=Eritrea
CountryEE=Estonia CountryEE=Estonia

View File

@ -49,6 +49,7 @@ DisableJavascript= Désactiver les fonctions Javascript et Ajax
ConfirmAjax= Utiliser les popups de confirmation Ajax ConfirmAjax= Utiliser les popups de confirmation Ajax
UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine. UseSearchToSelectCompany= Utiliser un champ avec autocomplétion pour choisir un tiers (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante SOCIETE_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
ActivityStateToSelectCompany= Ajouter une option de filtrage lors des recherches pour afficher/masquer les tiers en exercice ou ayant cessés d'exercer ActivityStateToSelectCompany= Ajouter une option de filtrage lors des recherches pour afficher/masquer les tiers en exercice ou ayant cessés d'exercer
UseSearchToSelectContact= Utiliser un champ avec autocomplétion pour choisir un contact (plutôt qu'une liste déroulante).<br><br>Notez que si vous avez un nombre important de produits ou services (> 100 000), vous pouvez améliorer les performances en définissant la constante CONTACT_DONOTSEARCH_ANYWHERE à 1 dans Configuration->Divers. La recherche sera alors limitée au début de la chaine.
SearchFilter=Options des filtres de recherche SearchFilter=Options des filtres de recherche
NumberOfKeyToSearch=Nb carac. déclenchant recherche: %s NumberOfKeyToSearch=Nb carac. déclenchant recherche: %s
ViewFullDateActions= Visualiser les dates des actions en entier dans la fiche tiers ViewFullDateActions= Visualiser les dates des actions en entier dans la fiche tiers

View File

@ -14,7 +14,7 @@ EventsNb=Nombre d'événements
MyEvents=Mes événements MyEvents=Mes événements
OtherEvents=Autres événements OtherEvents=Autres événements
ListOfActions=Liste des événements ListOfActions=Liste des événements
EventOnFullDay=Événement sur la journée EventOnFullDay=Événement sur la(les) journée(s)
Location=Lieu Location=Lieu
SearchAnAction=Rechercher un événement/tâche SearchAnAction=Rechercher un événement/tâche
MenuToDoActions=Les événem. incomplets MenuToDoActions=Les événem. incomplets

View File

@ -82,6 +82,21 @@ if ($action == 'COMPANY_USE_SEARCH_TO_SELECT')
} }
} }
if ($action == 'CONTACT_USE_SEARCH_TO_SELECT')
{
$contactsearch = GETPOST('activate_CONTACT_USE_SEARCH_TO_SELECT','alpha');
$res = dolibarr_set_const($db, "CONTACT_USE_SEARCH_TO_SELECT", $contactsearch,'chaine',0,'',$conf->entity);
if (! $res > 0) $error++;
if (! $error)
{
$mesg = "<font class=\"ok\">".$langs->trans("SetupSaved")."</font>";
}
else
{
$mesg = "<font class=\"error\">".$langs->trans("Error")."</font>";
}
}
// Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...) // Define constants for submodules that contains parameters (forms with param1, param2, ... and value1, value2, ...)
if ($action == 'setModuleOptions') if ($action == 'setModuleOptions')
{ {
@ -647,9 +662,37 @@ else
print '</tr>'; print '</tr>';
print '</form>'; print '</form>';
$var=!$var;
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="CONTACT_USE_SEARCH_TO_SELECT">';
print "<tr ".$bc[$var].">";
print '<td width="80%">'.$langs->trans("UseSearchToSelectContact").'</td>';
if (! $conf->use_javascript_ajax)
{
print '<td nowrap="nowrap" align="right" colspan="2">';
print $langs->trans("NotAvailableWhenAjaxDisabled");
print "</td>";
}
else
{
print '<td width="60" align="right">';
$arrval=array('0'=>$langs->trans("No"),
'1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",1).')',
'2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",2).')',
'3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",3).')',
);
print $form->selectarray("activate_CONTACT_USE_SEARCH_TO_SELECT",$arrval,$conf->global->CONTACT_USE_SEARCH_TO_SELECT);
print '</td><td align="right">';
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
print "</td>";
}
print '</tr>';
print '</table>'; print '</table>';
dol_fiche_end(); dol_fiche_end();
$db->close(); $db->close();

View File

@ -324,9 +324,7 @@ if ($action == 'update' && ! $_POST["cancel"])
$object->firstname = GETPOST("prenom"); $object->firstname = GETPOST("prenom");
$object->login = GETPOST("login"); $object->login = GETPOST("login");
$object->pass = GETPOST("password"); $object->pass = GETPOST("password");
if($user->admin == 1) { // A user can only be set admin by an admin $object->admin = empty($user->admin)?0:GETPOST("admin"); // A user can only be set admin by an admin
$object->admin = GETPOST("admin");
}
$object->office_phone=GETPOST("office_phone"); $object->office_phone=GETPOST("office_phone");
$object->office_fax = GETPOST("office_fax"); $object->office_fax = GETPOST("office_fax");
$object->user_mobile= GETPOST("user_mobile"); $object->user_mobile= GETPOST("user_mobile");