Merge branch 'develop' of https://github.com/Dolibarr/dolibarr into develop-api
This commit is contained in:
commit
313a432c33
@ -87,9 +87,6 @@ $hookmanager->initHooks(array('admin'));
|
|||||||
// This page is a generic page to edit dictionaries
|
// This page is a generic page to edit dictionaries
|
||||||
// Put here declaration of dictionaries properties
|
// Put here declaration of dictionaries properties
|
||||||
|
|
||||||
// Sort order to show dictionary (0 is space). All other dictionaries (added by modules) will be at end of this.
|
|
||||||
$taborder=array(9,0,4,3,2,0,1,8,19,16,27,0,5,11,0,33,34,0,6,0,29,0,7,17,24,28,0,10,23,12,13,0,14,0,22,20,18,21,0,15,30,0,25,0,26,0,31,32,0);
|
|
||||||
|
|
||||||
// Name of SQL tables of dictionaries
|
// Name of SQL tables of dictionaries
|
||||||
$tabname=array();
|
$tabname=array();
|
||||||
|
|
||||||
@ -148,75 +145,10 @@ $tabfieldcheck=array();
|
|||||||
$tabfieldcheck[31] = array();
|
$tabfieldcheck[31] = array();
|
||||||
$tabfieldcheck[32] = array();
|
$tabfieldcheck[32] = array();
|
||||||
|
|
||||||
// Complete all arrays with entries found into modules
|
|
||||||
complete_dictionary_with_modules($taborder,$tabname,$tablib,$tabsql,$tabsqlsort,$tabfield,$tabfieldvalue,$tabfieldinsert,$tabrowid,$tabcond,$tabhelp,$tabfieldcheck);
|
|
||||||
|
|
||||||
|
|
||||||
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
// Define elementList and sourceList (used for dictionary type of contacts "llx_c_type_contact")
|
||||||
$elementList = array();
|
$elementList = array();
|
||||||
$sourceList=array();
|
$sourceList=array();
|
||||||
if ($id == 11)
|
|
||||||
{
|
|
||||||
$langs->load("orders");
|
|
||||||
$langs->load("contracts");
|
|
||||||
$langs->load("projects");
|
|
||||||
$langs->load("propal");
|
|
||||||
$langs->load("bills");
|
|
||||||
$langs->load("interventions");
|
|
||||||
$elementList = array(
|
|
||||||
'' => '',
|
|
||||||
'societe' => $langs->trans('ThirdParty'),
|
|
||||||
// 'proposal' => $langs->trans('Proposal'),
|
|
||||||
// 'order' => $langs->trans('Order'),
|
|
||||||
// 'invoice' => $langs->trans('Bill'),
|
|
||||||
'invoice_supplier' => $langs->trans('SupplierBill'),
|
|
||||||
'order_supplier' => $langs->trans('SupplierOrder'),
|
|
||||||
// 'intervention' => $langs->trans('InterventionCard'),
|
|
||||||
// 'contract' => $langs->trans('Contract'),
|
|
||||||
'project' => $langs->trans('Project'),
|
|
||||||
'project_task' => $langs->trans('Task'),
|
|
||||||
'agenda' => $langs->trans('Agenda'),
|
|
||||||
// old deprecated
|
|
||||||
'contrat' => $langs->trans('Contract'),
|
|
||||||
'propal' => $langs->trans('Proposal'),
|
|
||||||
'commande' => $langs->trans('Order'),
|
|
||||||
'facture' => $langs->trans('Bill'),
|
|
||||||
'resource' => $langs->trans('Resource'),
|
|
||||||
// 'facture_fourn' => $langs->trans('SupplierBill'),
|
|
||||||
'fichinter' => $langs->trans('InterventionCard')
|
|
||||||
);
|
|
||||||
if (! empty($conf->global->MAIN_SUPPORT_SHARED_CONTACT_BETWEEN_THIRDPARTIES)) $elementList["societe"] = $langs->trans('ThirdParty');
|
|
||||||
|
|
||||||
complete_elementList_with_modules($elementList);
|
|
||||||
|
|
||||||
asort($elementList);
|
|
||||||
$sourceList = array(
|
|
||||||
'internal' => $langs->trans('Internal'),
|
|
||||||
'external' => $langs->trans('External')
|
|
||||||
);
|
|
||||||
}
|
|
||||||
if ($id == 25)
|
|
||||||
{
|
|
||||||
// We save list of template email Dolibarr can manage. This list can found by a grep into code on "->param['models']"
|
|
||||||
$elementList = array();
|
|
||||||
if ($conf->propal->enabled) $elementList['propal_send']=$langs->trans('MailToSendProposal');
|
|
||||||
if ($conf->commande->enabled) $elementList['order_send']=$langs->trans('MailToSendOrder');
|
|
||||||
if ($conf->facture->enabled) $elementList['facture_send']=$langs->trans('MailToSendInvoice');
|
|
||||||
if ($conf->expedition->enabled) $elementList['shipping_send']=$langs->trans('MailToSendShipment');
|
|
||||||
if ($conf->ficheinter->enabled) $elementList['fichinter_send']=$langs->trans('MailToSendIntervention');
|
|
||||||
if ($conf->supplier_proposal->enabled) $elementList['supplier_proposal_send']=$langs->trans('MailToSendSupplierRequestForQuotation');
|
|
||||||
if ($conf->fournisseur->enabled) $elementList['order_supplier_send']=$langs->trans('MailToSendSupplierOrder');
|
|
||||||
if ($conf->fournisseur->enabled) $elementList['invoice_supplier_send']=$langs->trans('MailToSendSupplierInvoice');
|
|
||||||
if ($conf->societe->enabled) $elementList['thirdparty']=$langs->trans('MailToThirdparty');
|
|
||||||
|
|
||||||
$parameters=array('elementList'=>$elementList);
|
|
||||||
$reshook=$hookmanager->executeHooks('emailElementlist',$parameters); // Note that $action and $object may have been modified by some hooks
|
|
||||||
if ($reshook == 0) {
|
|
||||||
foreach ($hookmanager->resArray as $item => $value) {
|
|
||||||
$elementList[$item] = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -690,7 +622,6 @@ if ($id)
|
|||||||
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
if ($fieldlist[$field]=='libelle' || $fieldlist[$field]=='label') $alabelisused=1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($id == 4) print '<td></td>';
|
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print '<input type="hidden" name="id" value="'.$id.'">';
|
print '<input type="hidden" name="id" value="'.$id.'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
@ -731,7 +662,6 @@ if ($id)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($id == 4) print '<td></td>';
|
|
||||||
print '<td colspan="3" align="right">';
|
print '<td colspan="3" align="right">';
|
||||||
if ($tabname[$id] != MAIN_DB_PREFIX.'c_email_templates' || $action != 'edit')
|
if ($tabname[$id] != MAIN_DB_PREFIX.'c_email_templates' || $action != 'edit')
|
||||||
{
|
{
|
||||||
@ -741,9 +671,8 @@ if ($id)
|
|||||||
print "</tr>";
|
print "</tr>";
|
||||||
|
|
||||||
$colspan=count($fieldlist)+3;
|
$colspan=count($fieldlist)+3;
|
||||||
if ($id == 4) $colspan++;
|
|
||||||
|
|
||||||
if (! empty($alabelisused) && $id != 25) // If there is one label among fields, we show legend of *
|
if (! empty($alabelisused)) // If there is one label among fields, we show legend of *
|
||||||
{
|
{
|
||||||
print '<tr><td colspan="'.$colspan.'">* '.$langs->trans("LabelUsedByDefault").'.</td></tr>';
|
print '<tr><td colspan="'.$colspan.'">* '.$langs->trans("LabelUsedByDefault").'.</td></tr>';
|
||||||
}
|
}
|
||||||
@ -775,9 +704,38 @@ if ($id)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Title of lines
|
// Title line with search boxes
|
||||||
print '<tr class="liste_titre liste_titre_add">';
|
print '<tr class="liste_titre liste_titre_add">';
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
|
{
|
||||||
|
$showfield=1; // By defaut
|
||||||
|
|
||||||
|
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
||||||
|
|
||||||
|
if ($showfield)
|
||||||
|
{
|
||||||
|
if ($value == 'country')
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre">';
|
||||||
|
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
||||||
|
print '</td>';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
print '<td class="liste_titre" colspan="2" align="right">';
|
||||||
|
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||||
|
print $searchpicto;
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Title of lines
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
foreach ($fieldlist as $field => $value)
|
||||||
{
|
{
|
||||||
// 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
|
||||||
@ -845,44 +803,11 @@ if ($id)
|
|||||||
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder);
|
print getTitleFieldOfList($valuetoshow, 0, $_SERVER["PHP_SELF"], ($sortable?$fieldlist[$field]:''), ($page?'page='.$page.'&':''), $param, "align=".$align, $sortfield, $sortorder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Favorite - Only activated on country dictionary
|
|
||||||
if ($id == 4) print getTitleFieldOfList($langs->trans("Favorite"), 0, $_SERVER["PHP_SELF"], "favorite", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder);
|
|
||||||
|
|
||||||
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder);
|
print getTitleFieldOfList($langs->trans("Status"), 0, $_SERVER["PHP_SELF"], "active", ($page?'page='.$page.'&':''), $param, 'align="center"', $sortfield, $sortorder);
|
||||||
print getTitleFieldOfList('');
|
print getTitleFieldOfList('');
|
||||||
print getTitleFieldOfList('');
|
print getTitleFieldOfList('');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Title line with search boxes
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
foreach ($fieldlist as $field => $value)
|
|
||||||
{
|
|
||||||
$showfield=1; // By defaut
|
|
||||||
|
|
||||||
if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
|
|
||||||
|
|
||||||
if ($showfield)
|
|
||||||
{
|
|
||||||
if ($value == 'country')
|
|
||||||
{
|
|
||||||
print '<td class="liste_titre">';
|
|
||||||
print $form->select_country($search_country_id, 'search_country_id', '', 28, 'maxwidth200 maxwidthonsmartphone');
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($id == 4) print '<td></td>';
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
print '<td class="liste_titre" colspan="2" align="right">';
|
|
||||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
|
||||||
print $searchpicto;
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
// Lines with values
|
// Lines with values
|
||||||
@ -1090,16 +1015,6 @@ if ($id)
|
|||||||
if ($param) $url .= '&'.$param;
|
if ($param) $url .= '&'.$param;
|
||||||
$url.='&';
|
$url.='&';
|
||||||
|
|
||||||
// Favorite
|
|
||||||
// Only activated on country dictionary
|
|
||||||
if ($id == 4)
|
|
||||||
{
|
|
||||||
print '<td align="center" class="nowrap">';
|
|
||||||
if ($iserasable) print '<a href="'.$url.'action='.$acts[$obj->favorite].'_favorite">'.$actl[$obj->favorite].'</a>';
|
|
||||||
else print $langs->trans("AlwaysActive");
|
|
||||||
print '</td>';
|
|
||||||
}
|
|
||||||
|
|
||||||
// Active
|
// Active
|
||||||
print '<td align="center" class="nowrap">';
|
print '<td align="center" class="nowrap">';
|
||||||
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
if ($canbedisabled) print '<a href="'.$url.'action='.$acts[$obj->active].'">'.$actl[$obj->active].'</a>';
|
||||||
@ -1135,65 +1050,6 @@ if ($id)
|
|||||||
|
|
||||||
print '</form>';
|
print '</form>';
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
* Show list of dictionary to show
|
|
||||||
*/
|
|
||||||
|
|
||||||
$lastlineisempty=false;
|
|
||||||
print '<table class="noborder" width="100%">';
|
|
||||||
print '<tr class="liste_titre">';
|
|
||||||
//print '<td>'.$langs->trans("Module").'</td>';
|
|
||||||
print '<td colspan="2">'.$langs->trans("Dictionary").'</td>';
|
|
||||||
print '<td>'.$langs->trans("Table").'</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
$showemptyline='';
|
|
||||||
foreach ($taborder as $i)
|
|
||||||
{
|
|
||||||
if (isset($tabname[$i]) && empty($tabcond[$i])) continue;
|
|
||||||
|
|
||||||
if ($i)
|
|
||||||
{
|
|
||||||
if ($showemptyline)
|
|
||||||
{
|
|
||||||
print '<tr class="oddeven"><td width="30%"> </td><td> </td><td> </td></tr>';
|
|
||||||
$showemptyline=0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$value=$tabname[$i];
|
|
||||||
print '<tr class="oddeven"><td width="50%">';
|
|
||||||
if (! empty($tabcond[$i]))
|
|
||||||
{
|
|
||||||
print '<a href="'.$_SERVER["PHP_SELF"].'?id='.$i.'">'.$langs->trans($tablib[$i]).'</a>';
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
print $langs->trans($tablib[$i]);
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '<td>';
|
|
||||||
/*if (empty($tabcond[$i]))
|
|
||||||
{
|
|
||||||
print info_admin($langs->trans("DictionaryDisabledSinceNoModuleNeedIt"),1);
|
|
||||||
}*/
|
|
||||||
print '</td>';
|
|
||||||
print '<td>'.$tabname[$i].'</td></tr>';
|
|
||||||
$lastlineisempty=false;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (! $lastlineisempty)
|
|
||||||
{
|
|
||||||
$showemptyline=1;
|
|
||||||
$lastlineisempty=true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print '</table>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
@ -354,6 +354,7 @@ if ($action == $acts[1])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* View
|
* View
|
||||||
*/
|
*/
|
||||||
@ -527,8 +528,25 @@ if ($id)
|
|||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Title line with search boxes
|
||||||
|
print '<tr class="liste_titre_filter liste_titre_add">';
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
print '<td class="liste_titre"></td>';
|
||||||
|
print '<td class="liste_titre" align="center">';
|
||||||
|
if ($filterfound)
|
||||||
|
{
|
||||||
|
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
||||||
|
print $searchpicto;
|
||||||
|
}
|
||||||
|
print '</td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Title of lines
|
// Title of lines
|
||||||
print '<tr class="liste_titre liste_titre_add">';
|
print '<tr class="liste_titre">';
|
||||||
foreach ($fieldlist as $field => $value)
|
foreach ($fieldlist as $field => $value)
|
||||||
{
|
{
|
||||||
// Determine le nom du champ par rapport aux noms possibles
|
// Determine le nom du champ par rapport aux noms possibles
|
||||||
@ -562,23 +580,6 @@ if ($id)
|
|||||||
print getTitleFieldOfList('');
|
print getTitleFieldOfList('');
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Title line with search boxes
|
|
||||||
print '<tr class="liste_titre_filter">';
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
print '<td class="liste_titre"></td>';
|
|
||||||
print '<td class="liste_titre" align="center">';
|
|
||||||
if ($filterfound)
|
|
||||||
{
|
|
||||||
$searchpicto=$form->showFilterAndCheckAddButtons(0);
|
|
||||||
print $searchpicto;
|
|
||||||
}
|
|
||||||
print '</td>';
|
|
||||||
print '</tr>';
|
|
||||||
|
|
||||||
if ($num)
|
if ($num)
|
||||||
{
|
{
|
||||||
// Lines with values
|
// Lines with values
|
||||||
|
|||||||
@ -419,7 +419,7 @@ class Adherent extends CommonObject
|
|||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
|
||||||
$sql.= " civility = ".($this->civility_id>0?$this->db->escape($this->civility_id):"null");
|
$sql.= " civility = ".($this->civility_id?"'".$this->db->escape($this->civility_id)."'":"null");
|
||||||
$sql.= ", firstname = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null");
|
$sql.= ", firstname = ".($this->firstname?"'".$this->db->escape($this->firstname)."'":"null");
|
||||||
$sql.= ", lastname = ".($this->lastname?"'".$this->db->escape($this->lastname)."'":"null");
|
$sql.= ", lastname = ".($this->lastname?"'".$this->db->escape($this->lastname)."'":"null");
|
||||||
$sql.= ", login = ".($this->login?"'".$this->db->escape($this->login)."'":"null");
|
$sql.= ", login = ".($this->login?"'".$this->db->escape($this->login)."'":"null");
|
||||||
@ -1959,25 +1959,49 @@ class Adherent extends CommonObject
|
|||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$info=array();
|
$info=array();
|
||||||
|
$keymodified=false;
|
||||||
|
|
||||||
// Object classes
|
// Object classes
|
||||||
$info["objectclass"]=explode(',',$conf->global->LDAP_MEMBER_OBJECT_CLASS);
|
$info["objectclass"]=explode(',',$conf->global->LDAP_MEMBER_OBJECT_CLASS);
|
||||||
|
|
||||||
$this->fullname=$this->getFullName($langs);
|
$this->fullname=$this->getFullName($langs);
|
||||||
|
|
||||||
|
// For avoid ldap error when firstname and lastname are empty
|
||||||
|
if ($this->morphy == 'mor' && empty($this->fullname)) {
|
||||||
|
$this->fullname = $this->societe;
|
||||||
|
$this->lastname = $this->societe;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Possible LDAP KEY (constname => varname)
|
||||||
|
$ldapkey = array(
|
||||||
|
'LDAP_MEMBER_FIELD_FULLNAME' => 'fullname',
|
||||||
|
'LDAP_MEMBER_FIELD_NAME' => 'lastname',
|
||||||
|
'LDAP_MEMBER_FIELD_LOGIN' => 'login',
|
||||||
|
'LDAP_MEMBER_FIELD_LOGIN_SAMBA' => 'login',
|
||||||
|
'LDAP_MEMBER_FIELD_MAIL' => 'email'
|
||||||
|
);
|
||||||
|
|
||||||
// Member
|
// Member
|
||||||
if ($this->fullname && ! empty($conf->global->LDAP_MEMBER_FIELD_FULLNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FULLNAME] = $this->fullname;
|
foreach ($ldapkey as $constname => $varname)
|
||||||
if ($this->lastname && ! empty($conf->global->LDAP_MEMBER_FIELD_NAME)) $info[$conf->global->LDAP_MEMBER_FIELD_NAME] = $this->lastname;
|
{
|
||||||
|
if (! empty($this->$varname) && ! empty($conf->global->$constname))
|
||||||
|
{
|
||||||
|
$info[$conf->global->$constname] = $this->$varname;
|
||||||
|
|
||||||
|
// Check if it is the LDAP key and if its value has been changed
|
||||||
|
if (! empty($conf->global->LDAP_KEY_MEMBERS) && $conf->global->LDAP_KEY_MEMBERS == $conf->global->$constname)
|
||||||
|
{
|
||||||
|
if (! empty($this->oldcopy) && $this->$varname != $this->oldcopy->$varname) $keymodified=true; // For check if LDAP key has been modified
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname;
|
if ($this->firstname && ! empty($conf->global->LDAP_MEMBER_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_MEMBER_FIELD_FIRSTNAME] = $this->firstname;
|
||||||
if ($this->login && ! empty($conf->global->LDAP_MEMBER_FIELD_LOGIN)) $info[$conf->global->LDAP_MEMBER_FIELD_LOGIN] = $this->login;
|
|
||||||
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
|
||||||
if ($this->pass && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // md5 for OpenLdap TODO add type of encryption
|
|
||||||
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
|
if ($this->poste && ! empty($conf->global->LDAP_MEMBER_FIELD_TITLE)) $info[$conf->global->LDAP_MEMBER_FIELD_TITLE] = $this->poste;
|
||||||
|
if ($this->societe && ! empty($conf->global->LDAP_MEMBER_FIELD_COMPANY)) $info[$conf->global->LDAP_MEMBER_FIELD_COMPANY] = $this->societe;
|
||||||
if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address;
|
if ($this->address && ! empty($conf->global->LDAP_MEMBER_FIELD_ADDRESS)) $info[$conf->global->LDAP_MEMBER_FIELD_ADDRESS] = $this->address;
|
||||||
if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip;
|
if ($this->zip && ! empty($conf->global->LDAP_MEMBER_FIELD_ZIP)) $info[$conf->global->LDAP_MEMBER_FIELD_ZIP] = $this->zip;
|
||||||
if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town;
|
if ($this->town && ! empty($conf->global->LDAP_MEMBER_FIELD_TOWN)) $info[$conf->global->LDAP_MEMBER_FIELD_TOWN] = $this->town;
|
||||||
if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
|
if ($this->country_code && ! empty($conf->global->LDAP_MEMBER_FIELD_COUNTRY)) $info[$conf->global->LDAP_MEMBER_FIELD_COUNTRY] = $this->country_code;
|
||||||
if ($this->email && ! empty($conf->global->LDAP_MEMBER_FIELD_MAIL)) $info[$conf->global->LDAP_MEMBER_FIELD_MAIL] = $this->email;
|
|
||||||
if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype;
|
if ($this->skype && ! empty($conf->global->LDAP_MEMBER_FIELD_SKYPE)) $info[$conf->global->LDAP_MEMBER_FIELD_SKYPE] = $this->skype;
|
||||||
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
|
if ($this->phone && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE] = $this->phone;
|
||||||
if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
|
if ($this->phone_perso && ! empty($conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO)) $info[$conf->global->LDAP_MEMBER_FIELD_PHONE_PERSO] = $this->phone_perso;
|
||||||
@ -1989,6 +2013,35 @@ class Adherent extends CommonObject
|
|||||||
if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
|
if (isset($this->statut) && ! empty($conf->global->LDAP_FIELD_MEMBER_STATUS)) $info[$conf->global->LDAP_FIELD_MEMBER_STATUS] = $this->statut;
|
||||||
if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
|
if ($this->datefin && ! empty($conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION)) $info[$conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION] = dol_print_date($this->datefin,'dayhourldap');
|
||||||
|
|
||||||
|
// When password is modified
|
||||||
|
if (! empty($this->pass))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||||
|
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)
|
||||||
|
}
|
||||||
|
// Set LDAP password if possible
|
||||||
|
else if ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
||||||
|
{
|
||||||
|
// Just for the default MD5 !
|
||||||
|
if (empty($conf->global->MAIN_SECURITY_HASH_ALGO))
|
||||||
|
{
|
||||||
|
if ($this->pass_indatabase_crypted && ! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) {
|
||||||
|
// Create OpenLDAP MD5 password from Dolibarr MD5 password
|
||||||
|
// Note: This suppose that "pass_indatabase_crypted" is a md5 (guaranted by the previous test if "(empty($conf->global->MAIN_SECURITY_HASH_ALGO))"
|
||||||
|
$info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = '{md5}'.base64_encode(hex2bin($this->pass_indatabase_crypted));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Use $this->pass_indatabase value if exists
|
||||||
|
else if (! empty($this->pass_indatabase))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD] = $this->pass_indatabase; // $this->pass_indatabase = mot de passe non crypte
|
||||||
|
if (! empty($conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_MEMBER_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Subscriptions
|
// Subscriptions
|
||||||
if ($this->first_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap');
|
if ($this->first_subscription_date && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE] = dol_print_date($this->first_subscription_date,'dayhourldap');
|
||||||
if (isset($this->first_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount;
|
if (isset($this->first_subscription_amount) && ! empty($conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT)) $info[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT] = $this->first_subscription_amount;
|
||||||
|
|||||||
@ -59,26 +59,23 @@ if (! $result)
|
|||||||
|
|
||||||
if ($action == 'dolibarr2ldap')
|
if ($action == 'dolibarr2ldap')
|
||||||
{
|
{
|
||||||
$db->begin();
|
|
||||||
|
|
||||||
$ldap=new Ldap();
|
$ldap=new Ldap();
|
||||||
$result=$ldap->connect_bind();
|
$result=$ldap->connect_bind();
|
||||||
|
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
$info=$object->_load_ldap_info();
|
$info=$object->_load_ldap_info();
|
||||||
$dn=$object->_load_ldap_dn($info);
|
$dn=$object->_load_ldap_dn($info);
|
||||||
$olddn=$dn; // We can say that old dn = dn as we force synchro
|
$olddn=$dn; // We can say that old dn = dn as we force synchro
|
||||||
|
|
||||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
$result=$ldap->update($dn,$info,$user,$olddn);
|
||||||
|
|
||||||
if ($result >= 0)
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs');
|
|
||||||
$db->commit();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if ($result >= 0) {
|
||||||
|
setEventMessages($langs->trans("MemberSynchronized"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else {
|
||||||
setEventMessages($ldap->errors, $ldap->error, 'errors');
|
setEventMessages($ldap->errors, $ldap->error, 'errors');
|
||||||
$db->rollback();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004-2013 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
|
||||||
* Copyright (C) 2011-2017 Philippe Grand <philippe.grand@atoo-net.com>
|
* Copyright (C) 2011-2017 Philippe Grand <philippe.grand@atoo-net.com>
|
||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
@ -45,10 +45,18 @@ if (! $user->admin) accessforbidden();
|
|||||||
|
|
||||||
$error=0;
|
$error=0;
|
||||||
|
|
||||||
|
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
|
||||||
|
$contextpage=array('admincompany','globaladmin');
|
||||||
|
$hookmanager->initHooks($contextpage);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
$parameters=array();
|
||||||
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
|
if ( ($action == 'update' && ! GETPOST("cancel",'alpha'))
|
||||||
|| ($action == 'updateedit') )
|
|| ($action == 'updateedit') )
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
* Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
|
||||||
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
* Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
|
||||||
* Copyright (C) 2005 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2005-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2006-2008 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
* Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
|
||||||
*
|
*
|
||||||
@ -68,6 +68,7 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_COMPANY',GETPOST("fieldcompany"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_MEMBER_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
@ -282,6 +283,14 @@ print '</td><td>'.$langs->trans("LDAPFieldFaxExample").'</td>';
|
|||||||
print '<td align="right"> </td>';
|
print '<td align="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Company
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCompany").'</td><td>';
|
||||||
|
print '<input size="25" type="text" name="fieldcompany" value="'.$conf->global->LDAP_MEMBER_FIELD_COMPANY.'">';
|
||||||
|
print '</td><td>'.$langs->trans("LDAPFieldCompanyExample").'</td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Address
|
// Address
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldAddress").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldAddress").'</td><td>';
|
||||||
|
|||||||
@ -65,6 +65,11 @@ if ($action == 'setvalue' && $user->admin)
|
|||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_MOBILE',GETPOST("fieldmobile"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_SKYPE',GETPOST("fieldskype"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_FAX',GETPOST("fieldfax"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_COMPANY',GETPOST("fieldcompany"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_ADDRESS',GETPOST("fieldaddress"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_ZIP',GETPOST("fieldzip"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_TOWN',GETPOST("fieldtown"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_COUNTRY',GETPOST("fieldcountry"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_DESCRIPTION',GETPOST("fielddescription"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_SID',GETPOST("fieldsid"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE',GETPOST("fieldtitle"),'chaine',0,'',$conf->entity)) $error++;
|
if (! dolibarr_set_const($db, 'LDAP_FIELD_TITLE',GETPOST("fieldtitle"),'chaine',0,'',$conf->entity)) $error++;
|
||||||
@ -208,7 +213,7 @@ print '</tr>';
|
|||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPasswordNotCrypted").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPasswordNotCrypted").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldpassword" value="'.$conf->global->LDAP_FIELD_PASSWORD.'">';
|
print '<input size="25" type="text" name="fieldpassword" value="'.$conf->global->LDAP_FIELD_PASSWORD.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldPasswordExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldPasswordExample").'</td>';
|
||||||
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_PASSWORD"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PASSWORD)?' checked':'')."></td>";
|
print '<td align="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Password crypted
|
// Password crypted
|
||||||
@ -216,7 +221,7 @@ print '</tr>';
|
|||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPasswordCrypted").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldPasswordCrypted").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldpasswordcrypted" value="'.$conf->global->LDAP_FIELD_PASSWORD_CRYPTED.'">';
|
print '<input size="25" type="text" name="fieldpasswordcrypted" value="'.$conf->global->LDAP_FIELD_PASSWORD_CRYPTED.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldPasswordExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldPasswordExample").'</td>';
|
||||||
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_PASSWORD_CRYPTED"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_PASSWORD_CRYPTED)?' checked':'')."></td>";
|
print '<td align="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Mail
|
// Mail
|
||||||
@ -259,12 +264,52 @@ print '</td><td>'.$langs->trans("LDAPFieldFaxExample").'</td>';
|
|||||||
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_FAX"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FAX)?' checked':'')."></td>";
|
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_FAX"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_FAX)?' checked':'')."></td>";
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
|
// Company
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCompany").'</td><td>';
|
||||||
|
print '<input size="25" type="text" name="fieldcompany" value="'.$conf->global->LDAP_FIELD_COMPANY.'">';
|
||||||
|
print '</td><td>'.$langs->trans("LDAPFieldCompanyExample").'</td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// Address
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldAddress").'</td><td>';
|
||||||
|
print '<input size="25" type="text" name="fieldaddress" value="'.$conf->global->LDAP_FIELD_ADDRESS.'">';
|
||||||
|
print '</td><td>'.$langs->trans("LDAPFieldAddressExample").'</td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// ZIP
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldZip").'</td><td>';
|
||||||
|
print '<input size="25" type="text" name="fieldzip" value="'.$conf->global->LDAP_FIELD_ZIP.'">';
|
||||||
|
print '</td><td>'.$langs->trans("LDAPFieldZipExample").'</td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// TOWN
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldTown").'</td><td>';
|
||||||
|
print '<input size="25" type="text" name="fieldtown" value="'.$conf->global->LDAP_FIELD_TOWN.'">';
|
||||||
|
print '</td><td>'.$langs->trans("LDAPFieldTownExample").'</td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
|
// COUNTRY
|
||||||
|
|
||||||
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldCountry").'</td><td>';
|
||||||
|
print '<input size="25" type="text" name="fieldcountry" value="'.$conf->global->LDAP_FIELD_COUNTRY.'">';
|
||||||
|
print '</td><td> </td>';
|
||||||
|
print '<td align="right"> </td>';
|
||||||
|
print '</tr>';
|
||||||
|
|
||||||
// Title
|
// Title
|
||||||
|
|
||||||
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldTitle").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("LDAPFieldTitle").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fieldtitle" value="'.$conf->global->LDAP_FIELD_TITLE.'">';
|
print '<input size="25" type="text" name="fieldtitle" value="'.$conf->global->LDAP_FIELD_TITLE.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldTitleExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldTitleExample").'</td>';
|
||||||
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_TITLE"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_TITLE)?' checked':'')."></td>";
|
print '<td align="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Note
|
// Note
|
||||||
@ -272,7 +317,7 @@ print '</tr>';
|
|||||||
print '<tr class="oddeven"><td>'.$langs->trans("Note").'</td><td>';
|
print '<tr class="oddeven"><td>'.$langs->trans("Note").'</td><td>';
|
||||||
print '<input size="25" type="text" name="fielddescription" value="'.$conf->global->LDAP_FIELD_DESCRIPTION.'">';
|
print '<input size="25" type="text" name="fielddescription" value="'.$conf->global->LDAP_FIELD_DESCRIPTION.'">';
|
||||||
print '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
|
print '</td><td>'.$langs->trans("LDAPFieldDescriptionExample").'</td>';
|
||||||
print '<td align="right"><input type="radio" name="key" value="LDAP_FIELD_DESCRIPTION"'.(($conf->global->LDAP_KEY_USERS && $conf->global->LDAP_KEY_USERS==$conf->global->LDAP_FIELD_DESCRIPTION)?' checked':'')."></td>";
|
print '<td align="right"> </td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Sid
|
// Sid
|
||||||
|
|||||||
@ -1690,7 +1690,15 @@ if ($action == 'create')
|
|||||||
//array('type' => 'other','name' => 'note_private', 'label' => $langs->trans("Note"),'value' => '<textarea cols="30" rows="' . ROWS_3 . '" wrap="soft" name="note_private" id="note_private">'.$object->note_private.'</textarea>'));
|
//array('type' => 'other','name' => 'note_private', 'label' => $langs->trans("Note"),'value' => '<textarea cols="30" rows="' . ROWS_3 . '" wrap="soft" name="note_private" id="note_private">'.$object->note_private.'</textarea>'));
|
||||||
array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"),'value' => $object->note_private));
|
array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"),'value' => $object->note_private));
|
||||||
|
|
||||||
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), '', 'setstatut', $formquestion, '', 1, 250);
|
if (! empty($conf->notification->enabled)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/core/class/notify.class.php';
|
||||||
|
$notify = new Notify($db);
|
||||||
|
$formquestion = array_merge($formquestion, array(
|
||||||
|
array('type' => 'onecolumn', 'value' => $notify->confirmMessage('PROPAL_CLOSE_SIGNED', $object->socid, $object)),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . $object->id, $langs->trans('SetAcceptedRefused'), $text, 'setstatut', $formquestion, '', 1, 250);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -239,20 +239,24 @@ class Proposals extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function postLine($id, $request_data = NULL) {
|
function postLine($id, $request_data = NULL)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->propal->fetch($id);
|
$result = $this->propal->fetch($id);
|
||||||
if( ! $result ) {
|
if (! $result) {
|
||||||
throw new RestException(404, 'Commercial Proposal not found');
|
throw new RestException(404, 'Commercial Proposal not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
if (! DolibarrApi::_checkAccessToResource('propal',$this->propal->id))
|
||||||
|
{
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$request_data = (object) $request_data;
|
$request_data = (object) $request_data;
|
||||||
|
|
||||||
$updateRes = $this->propal->addline(
|
$updateRes = $this->propal->addline(
|
||||||
$request_data->desc,
|
$request_data->desc,
|
||||||
$request_data->subprice,
|
$request_data->subprice,
|
||||||
@ -300,43 +304,52 @@ class Proposals extends DolibarrApi
|
|||||||
*
|
*
|
||||||
* @return object
|
* @return object
|
||||||
*/
|
*/
|
||||||
function putLine($id, $lineid, $request_data = NULL) {
|
function putLine($id, $lineid, $request_data = NULL)
|
||||||
|
{
|
||||||
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
if(! DolibarrApiAccess::$user->rights->propal->creer) {
|
||||||
throw new RestException(401);
|
throw new RestException(401);
|
||||||
}
|
}
|
||||||
|
|
||||||
$result = $this->propal->fetch($id);
|
$result = $this->propal->fetch($id);
|
||||||
if( ! $result ) {
|
if($result <= 0) {
|
||||||
throw new RestException(404, 'Proposal not found');
|
throw new RestException(404, 'Proposal not found');
|
||||||
}
|
}
|
||||||
|
|
||||||
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
if( ! DolibarrApi::_checkAccessToResource('propal',$this->propal->id)) {
|
||||||
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
throw new RestException(401, 'Access not allowed for login '.DolibarrApiAccess::$user->login);
|
||||||
}
|
}
|
||||||
|
|
||||||
$request_data = (object) $request_data;
|
$request_data = (object) $request_data;
|
||||||
|
|
||||||
|
$propalline = new PropaleLigne($this->db);
|
||||||
|
$result = $propalline->fetch($lineid);
|
||||||
|
if ($result <= 0) {
|
||||||
|
throw new RestException(404, 'Proposal line not found');
|
||||||
|
}
|
||||||
|
|
||||||
$updateRes = $this->propal->updateline(
|
$updateRes = $this->propal->updateline(
|
||||||
$lineid,
|
$lineid,
|
||||||
$request_data->subprice,
|
isset($request_data->subprice)?$request_data->subprice:$propalline->subprice,
|
||||||
$request_data->qty,
|
isset($request_data->qty)?$request_data->qty:$propalline->qty,
|
||||||
$request_data->remise_percent,
|
isset($request_data->remise_percent)?$request_data->remise_percent:$propalline->remise_percent,
|
||||||
$request_data->tva_tx,
|
isset($request_data->tva_tx)?$request_data->tva_tx:$propalline->tva_tx,
|
||||||
$request_data->localtax1_tx,
|
isset($request_data->localtax1_tx)?$request_data->localtax1_tx:$propalline->localtax1_tx,
|
||||||
$request_data->localtax2_tx,
|
isset($request_data->localtax2_tx)?$request_data->localtax2_tx:$propalline->localtax2_tx,
|
||||||
$request_data->desc,
|
isset($request_data->desc)?$request_data->desc:$propalline->desc,
|
||||||
'HT',
|
'HT',
|
||||||
$request_data->info_bits,
|
isset($request_data->info_bits)?$request_data->info_bits:$propalline->info_bits,
|
||||||
$request_data->special_code,
|
isset($request_data->special_code)?$request_data->special_code:$propalline->special_code,
|
||||||
$request_data->fk_parent_line,
|
isset($request_data->fk_parent_line)?$request_data->fk_parent_line:$propalline->fk_parent_line,
|
||||||
0,
|
0,
|
||||||
$request_data->fk_fournprice,
|
isset($request_data->fk_fournprice)?$request_data->fk_fournprice:$propalline->fk_fournprice,
|
||||||
$request_data->pa_ht,
|
isset($request_data->pa_ht)?$request_data->pa_ht:$propalline->pa_ht,
|
||||||
$request_data->label,
|
isset($request_data->label)?$request_data->label:$propalline->label,
|
||||||
$request_data->product_type,
|
isset($request_data->product_type)?$request_data->product_type:$propalline->product_type,
|
||||||
$request_data->date_start,
|
isset($request_data->date_start)?$request_data->date_start:$propalline->date_start,
|
||||||
$request_data->date_end,
|
isset($request_data->date_end)?$request_data->date_end:$propalline->date_end,
|
||||||
$request_data->array_options,
|
isset($request_data->array_options)?$request_data->array_options:$propalline->array_options,
|
||||||
$request_data->fk_unit,
|
isset($request_data->fk_unit)?$request_data->fk_unit:$propalline->fk_unit,
|
||||||
$request_data->multicurrency_subprice
|
isset($request_data->multicurrency_subprice)?$request_data->multicurrency_subprice:$propalline->subprice
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($updateRes > 0) {
|
if ($updateRes > 0) {
|
||||||
|
|||||||
@ -3654,6 +3654,8 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
{
|
{
|
||||||
$objp = $this->db->fetch_object($result);
|
$objp = $this->db->fetch_object($result);
|
||||||
|
|
||||||
|
if ($objp)
|
||||||
|
{
|
||||||
$this->id = $objp->rowid;
|
$this->id = $objp->rowid;
|
||||||
$this->rowid = $objp->rowid; // deprecated
|
$this->rowid = $objp->rowid; // deprecated
|
||||||
$this->fk_propal = $objp->fk_propal;
|
$this->fk_propal = $objp->fk_propal;
|
||||||
@ -3709,6 +3711,11 @@ class PropaleLigne extends CommonObjectLine
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -324,11 +324,11 @@ if ($action == 'create')
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
print '<tr><td class="fieldrequired titlefieldcreate">'.$langs->trans("Ref").'</td>';
|
||||||
print '<td><input size="8" type="text" class="flat" name="ref" value="'.(GETPOST("ref")?GETPOST("ref",'alpha'):$object->ref).'" maxlength="12"></td></tr>';
|
print '<td><input size="8" type="text" class="flat" name="ref" value="'.dol_escape_htmltag(GETPOST("ref")?GETPOST("ref",'alpha'):$object->ref).'" maxlength="12" autofocus></td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("LabelBankCashAccount").'</td>';
|
||||||
print '<td><input size="30" type="text" class="flat" name="label" value="'.GETPOST("label", 'alpha').'"></td></tr>';
|
print '<td><input size="30" type="text" class="flat" name="label" value="'.dol_escape_htmltag(GETPOST("label", 'alpha')).'"></td></tr>';
|
||||||
|
|
||||||
// Type
|
// Type
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("AccountType").'</td>';
|
||||||
@ -349,7 +349,7 @@ if ($action == 'create')
|
|||||||
// Status
|
// Status
|
||||||
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
|
print '<tr><td class="fieldrequired">'.$langs->trans("Status").'</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
print $form->selectarray("clos", $object->status,(isset($_POST["clos"])?$_POST["clos"]:$object->clos));
|
print $form->selectarray("clos", $object->status,(GETPOST("clos",'int')!=''?GETPOST("clos",'int'):$object->clos));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Country
|
// Country
|
||||||
|
|||||||
@ -74,7 +74,7 @@ if ($mode == 'customer')
|
|||||||
if ($mode == 'supplier')
|
if ($mode == 'supplier')
|
||||||
{
|
{
|
||||||
$title=$langs->trans("BillsStatisticsSuppliers");
|
$title=$langs->trans("BillsStatisticsSuppliers");
|
||||||
$dir=$conf->fournisseur->dir_output.'/facture/temp';
|
$dir=$conf->fournisseur->facture->dir_temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
print load_fiche_titre($title, $mesg, 'title_accountancy.png');
|
print load_fiche_titre($title, $mesg, 'title_accountancy.png');
|
||||||
|
|||||||
@ -308,7 +308,7 @@ if ($action == 'create')
|
|||||||
print '<td class="titlefieldcreate fieldrequired">';
|
print '<td class="titlefieldcreate fieldrequired">';
|
||||||
print $langs->trans("Label");
|
print $langs->trans("Label");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" size="34" name="label" class="flat" value="'.GETPOST('label').'"></td>';
|
print '<td><input type="text" size="34" name="label" class="flat" value="'.dol_escape_htmltag(GETPOST('label','alpha')).'" autofocus></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
print '<tr>';
|
print '<tr>';
|
||||||
|
|
||||||
@ -317,7 +317,7 @@ if ($action == 'create')
|
|||||||
print $langs->trans("Type");
|
print $langs->trans("Type");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
$formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode")?GETPOST("actioncode"):'','actioncode',1);
|
$formsocialcontrib->select_type_socialcontrib(GETPOST("actioncode",'alpha')?GETPOST("actioncode",'alpha'):'','actioncode',1);
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
@ -336,7 +336,7 @@ if ($action == 'create')
|
|||||||
print '<td class="fieldrequired">';
|
print '<td class="fieldrequired">';
|
||||||
print $langs->trans("Amount");
|
print $langs->trans("Amount");
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '<td><input type="text" size="6" name="amount" class="flat" value="'.GETPOST('amount').'"></td>';
|
print '<td><input type="text" size="6" name="amount" class="flat" value="'.dol_escape_htmltag(GETPOST('amount','alpha')).'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Project
|
// Project
|
||||||
|
|||||||
@ -298,7 +298,7 @@ class Comment extends CommonObject
|
|||||||
$sql.= " c.rowid";
|
$sql.= " c.rowid";
|
||||||
$sql.= " FROM ".MAIN_DB_PREFIX."comment as c";
|
$sql.= " FROM ".MAIN_DB_PREFIX."comment as c";
|
||||||
$sql.= " WHERE c.fk_element = ".$fk_element;
|
$sql.= " WHERE c.fk_element = ".$fk_element;
|
||||||
$sql.= " AND c.element_type = '".$element_type."'";
|
$sql.= " AND c.element_type = '".$this->db->escape($element_type)."'";
|
||||||
$sql.= " AND c.entity = ".$conf->entity;
|
$sql.= " AND c.entity = ".$conf->entity;
|
||||||
$sql.= " ORDER BY c.tms DESC";
|
$sql.= " ORDER BY c.tms DESC";
|
||||||
|
|
||||||
|
|||||||
@ -12,6 +12,7 @@
|
|||||||
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org>
|
* Copyright (C) 2016 Bahfir abbes <dolipar@dolipar.org>
|
||||||
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
|
* Copyright (C) 2017 ATM Consulting <support@atm-consulting.fr>
|
||||||
|
* Copyright (C) 2017 Nicolas ZABOURI <info@inovea-conseil.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
|
||||||
@ -2260,6 +2261,31 @@ abstract class CommonObject
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
|
// Some external module want no update price after a trigger because they have another method to calculate the total (ex: with an extrafield)
|
||||||
|
$MODULE = "";
|
||||||
|
if ($this->element == 'propal')
|
||||||
|
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_PROPOSAL";
|
||||||
|
elseif ($this->element == 'order')
|
||||||
|
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_ORDER";
|
||||||
|
elseif ($this->element == 'facture')
|
||||||
|
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_INVOICE";
|
||||||
|
elseif ($this->element == 'facture_fourn')
|
||||||
|
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_SUPPLIER_INVOICE";
|
||||||
|
elseif ($this->element == 'order_supplier')
|
||||||
|
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_SUPPLIER_ORDER";
|
||||||
|
elseif ($this->element == 'supplier_proposal')
|
||||||
|
$MODULE = "MODULE_DISALLOW_UPDATE_PRICE_SUPPLIER_PROPOSAL";
|
||||||
|
|
||||||
|
if (! empty($MODULE)) {
|
||||||
|
if (! empty($conf->global->$MODULE)) {
|
||||||
|
$modsactivated = explode(',', $conf->global->$MODULE);
|
||||||
|
foreach ($modsactivated as $mod) {
|
||||||
|
if ($conf->$mod->enabled)
|
||||||
|
return 1; // update was disabled by specific setup
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
include_once DOL_DOCUMENT_ROOT.'/core/lib/price.lib.php';
|
||||||
|
|
||||||
if ($roundingadjust == '-1') $roundingadjust='auto'; // For backward compatibility
|
if ($roundingadjust == '-1') $roundingadjust='auto'; // For backward compatibility
|
||||||
@ -2385,7 +2411,8 @@ abstract class CommonObject
|
|||||||
$this->multicurrency_total_ttc += isset($this->revenuestamp)?($this->revenuestamp * $multicurrency_tx):0;
|
$this->multicurrency_total_ttc += isset($this->revenuestamp)?($this->revenuestamp * $multicurrency_tx):0;
|
||||||
|
|
||||||
// Situations totals
|
// Situations totals
|
||||||
if ($this->situation_cycle_ref && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits')) {
|
if ($this->situation_cycle_ref && $this->situation_counter > 1 && method_exists($this, 'get_prev_sits'))
|
||||||
|
{
|
||||||
$prev_sits = $this->get_prev_sits();
|
$prev_sits = $this->get_prev_sits();
|
||||||
|
|
||||||
foreach ($prev_sits as $sit) { // $sit is an object Facture loaded with a fetch.
|
foreach ($prev_sits as $sit) { // $sit is an object Facture loaded with a fetch.
|
||||||
|
|||||||
@ -3635,6 +3635,13 @@ class Form
|
|||||||
$more.=$input['value'];
|
$more.=$input['value'];
|
||||||
$more.='</td></tr>'."\n";
|
$more.='</td></tr>'."\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
else if ($input['type'] == 'onecolumn')
|
||||||
|
{
|
||||||
|
$more.='<tr><td colspan="3" align="left">';
|
||||||
|
$more.=$input['value'];
|
||||||
|
$more.='</td></tr>'."\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$more.='</table>'."\n";
|
$more.='</table>'."\n";
|
||||||
@ -5701,8 +5708,8 @@ class Form
|
|||||||
'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'),
|
'contrat'=>array('enabled'=>$conf->contrat->enabled , 'perms'=>1, 'label'=>'LinkToContract', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, '' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."contrat as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('contract').')'),
|
||||||
'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'),
|
'fichinter'=>array('enabled'=>$conf->ficheinter->enabled, 'perms'=>1, 'label'=>'LinkToIntervention', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."fichinter as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('intervention').')'),
|
||||||
'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal').')'),
|
'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled , 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('supplier_proposal').')'),
|
||||||
'order_supplier'=>array('enabled'=>$conf->fournisseur->commande->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur').')'),
|
'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled , 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('commande_fournisseur').')'),
|
||||||
'invoice_supplier'=>array('enabled'=>$conf->fournisseur->facture->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn').')')
|
'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled , 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('facture_fourn').')')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -458,7 +458,7 @@ class Ldap
|
|||||||
*
|
*
|
||||||
* @param string $dn DN entry key
|
* @param string $dn DN entry key
|
||||||
* @param array $info Attributes array
|
* @param array $info Attributes array
|
||||||
* @param string $user Objet user that modify
|
* @param User $user Objet user that modify
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function modify($dn, $info, $user)
|
function modify($dn, $info, $user)
|
||||||
@ -504,6 +504,56 @@ class Ldap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rename a LDAP entry
|
||||||
|
* Ldap object connect and bind must have been done
|
||||||
|
*
|
||||||
|
* @param string $dn Old DN entry key (uid=qqq,ou=xxx,dc=aaa,dc=bbb) (before update)
|
||||||
|
* @param string $newrdn New RDN entry key (uid=qqq)
|
||||||
|
* @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb)
|
||||||
|
* @param User $user Objet user that modify
|
||||||
|
* @param bool $deleteoldrdn If TRUE the old RDN value(s) is removed, else the old RDN value(s) is retained as non-distinguished values of the entry.
|
||||||
|
* @return int <0 if KO, >0 if OK
|
||||||
|
*/
|
||||||
|
function rename($dn, $newrdn, $newparent, $user, $deleteoldrdn = true)
|
||||||
|
{
|
||||||
|
global $conf;
|
||||||
|
|
||||||
|
dol_syslog(get_class($this)."::modify dn=".$dn." newrdn=".$newrdn." newparent=".$newparent." deleteoldrdn=".($deleteoldrdn?1:0));
|
||||||
|
|
||||||
|
// Check parameters
|
||||||
|
if (! $this->connection)
|
||||||
|
{
|
||||||
|
$this->error="NotConnected";
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
if (! $this->bind)
|
||||||
|
{
|
||||||
|
$this->error="NotConnected";
|
||||||
|
return -3;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Encode to LDAP page code
|
||||||
|
$dn=$this->convFromOutputCharset($dn,$this->ldapcharset);
|
||||||
|
$newrdn=$this->convFromOutputCharset($newrdn,$this->ldapcharset);
|
||||||
|
$newparent=$this->convFromOutputCharset($newparent,$this->ldapcharset);
|
||||||
|
|
||||||
|
//print_r($info);
|
||||||
|
$result=@ldap_rename($this->connection, $dn, $newrdn, $newparent, $deleteoldrdn);
|
||||||
|
|
||||||
|
if ($result)
|
||||||
|
{
|
||||||
|
dol_syslog(get_class($this)."::rename successfull", LOG_DEBUG);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->error=@ldap_error($this->connection);
|
||||||
|
dol_syslog(get_class($this)."::rename failed: ".$this->error, LOG_ERR);
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modify a LDAP entry (to use if dn != olddn)
|
* Modify a LDAP entry (to use if dn != olddn)
|
||||||
* Ldap object connect and bind must have been done
|
* Ldap object connect and bind must have been done
|
||||||
@ -512,9 +562,11 @@ class Ldap
|
|||||||
* @param array $info Attributes array
|
* @param array $info Attributes array
|
||||||
* @param User $user Objet user that update
|
* @param User $user Objet user that update
|
||||||
* @param string $olddn Old DN entry key (before update)
|
* @param string $olddn Old DN entry key (before update)
|
||||||
|
* @param string $newrdn New RDN entry key (uid=qqq) (for ldap_rename)
|
||||||
|
* @param string $newparent New parent (ou=xxx,dc=aaa,dc=bbb) (for ldap_rename)
|
||||||
* @return int <0 if KO, >0 if OK
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function update($dn,$info,$user,$olddn)
|
function update($dn, $info, $user, $olddn, $newrdn=false, $newparent=false)
|
||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
@ -533,11 +585,19 @@ class Ldap
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (! $olddn || $olddn != $dn)
|
if (! $olddn || $olddn != $dn)
|
||||||
|
{
|
||||||
|
if (! empty($olddn) && ! empty($newrdn) && ! empty($newparent) && $conf->global->LDAP_SERVER_PROTOCOLVERSION === '3')
|
||||||
|
{
|
||||||
|
// This function currently only works with LDAPv3
|
||||||
|
$result = $this->rename($olddn, $newrdn, $newparent, $user, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
// If change we make is rename the key of LDAP record, we create new one and if ok, we delete old one.
|
// If change we make is rename the key of LDAP record, we create new one and if ok, we delete old one.
|
||||||
$result = $this->add($dn, $info, $user);
|
$result = $this->add($dn, $info, $user);
|
||||||
if ($result > 0 && $olddn && $olddn != $dn) $result = $this->delete($olddn); // If add fails, we do not try to delete old one
|
if ($result > 0 && $olddn && $olddn != $dn) $result = $this->delete($olddn); // If add fails, we do not try to delete old one
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//$result = $this->delete($olddn);
|
//$result = $this->delete($olddn);
|
||||||
@ -1298,7 +1358,8 @@ class Ldap
|
|||||||
function parseUACF($uacf)
|
function parseUACF($uacf)
|
||||||
{
|
{
|
||||||
//All flags array
|
//All flags array
|
||||||
$flags = array( "TRUSTED_TO_AUTH_FOR_DELEGATION" => 16777216,
|
$flags = array(
|
||||||
|
"TRUSTED_TO_AUTH_FOR_DELEGATION" => 16777216,
|
||||||
"PASSWORD_EXPIRED" => 8388608,
|
"PASSWORD_EXPIRED" => 8388608,
|
||||||
"DONT_REQ_PREAUTH" => 4194304,
|
"DONT_REQ_PREAUTH" => 4194304,
|
||||||
"USE_DES_KEY_ONLY" => 2097152,
|
"USE_DES_KEY_ONLY" => 2097152,
|
||||||
@ -1318,7 +1379,8 @@ class Ldap
|
|||||||
"LOCKOUT" => 16,
|
"LOCKOUT" => 16,
|
||||||
"HOMEDIR_REQUIRED" => 8,
|
"HOMEDIR_REQUIRED" => 8,
|
||||||
"ACCOUNTDISABLE" => 2,
|
"ACCOUNTDISABLE" => 2,
|
||||||
"SCRIPT" => 1);
|
"SCRIPT" => 1
|
||||||
|
);
|
||||||
|
|
||||||
//Parse flags to text
|
//Parse flags to text
|
||||||
$retval = array();
|
$retval = array();
|
||||||
@ -1341,13 +1403,15 @@ class Ldap
|
|||||||
*/
|
*/
|
||||||
function parseSAT($samtype)
|
function parseSAT($samtype)
|
||||||
{
|
{
|
||||||
$stypes = array( 805306368 => "NORMAL_ACCOUNT",
|
$stypes = array(
|
||||||
|
805306368 => "NORMAL_ACCOUNT",
|
||||||
805306369 => "WORKSTATION_TRUST",
|
805306369 => "WORKSTATION_TRUST",
|
||||||
805306370 => "INTERDOMAIN_TRUST",
|
805306370 => "INTERDOMAIN_TRUST",
|
||||||
268435456 => "SECURITY_GLOBAL_GROUP",
|
268435456 => "SECURITY_GLOBAL_GROUP",
|
||||||
268435457 => "DISTRIBUTION_GROUP",
|
268435457 => "DISTRIBUTION_GROUP",
|
||||||
536870912 => "SECURITY_LOCAL_GROUP",
|
536870912 => "SECURITY_LOCAL_GROUP",
|
||||||
536870913 => "DISTRIBUTION_LOCAL_GROUP");
|
536870913 => "DISTRIBUTION_LOCAL_GROUP"
|
||||||
|
);
|
||||||
|
|
||||||
$retval = "";
|
$retval = "";
|
||||||
while (list($sat, $val) = each($stypes)) {
|
while (list($sat, $val) = each($stypes)) {
|
||||||
@ -1422,7 +1486,7 @@ class Ldap
|
|||||||
|
|
||||||
$search='('.$conf->global->$keygroup.'=*)';
|
$search='('.$conf->global->$keygroup.'=*)';
|
||||||
$result = $this->search($this->groups,$search);
|
$result = $this->search($this->groups,$search);
|
||||||
if($result)
|
if ($result)
|
||||||
{
|
{
|
||||||
$c = $result['count'];
|
$c = $result['count'];
|
||||||
$gids = array();
|
$gids = array();
|
||||||
|
|||||||
@ -50,6 +50,7 @@ class Notify
|
|||||||
'BILL_PAYED',
|
'BILL_PAYED',
|
||||||
'ORDER_VALIDATE',
|
'ORDER_VALIDATE',
|
||||||
'PROPAL_VALIDATE',
|
'PROPAL_VALIDATE',
|
||||||
|
'PROPAL_CLOSE_SIGNED',
|
||||||
'FICHINTER_VALIDATE',
|
'FICHINTER_VALIDATE',
|
||||||
'FICHINTER_ADD_CONTACT',
|
'FICHINTER_ADD_CONTACT',
|
||||||
'ORDER_SUPPLIER_VALIDATE',
|
'ORDER_SUPPLIER_VALIDATE',
|
||||||
@ -395,6 +396,12 @@ class Notify
|
|||||||
$object_type = 'propal';
|
$object_type = 'propal';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
|
||||||
break;
|
break;
|
||||||
|
case 'PROPAL_CLOSE_SIGNED':
|
||||||
|
$link='/comm/propal/card.php?id='.$object->id;
|
||||||
|
$dir_output = $conf->propal->dir_output;
|
||||||
|
$object_type = 'propal';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref);
|
||||||
|
break;
|
||||||
case 'FICHINTER_ADD_CONTACT':
|
case 'FICHINTER_ADD_CONTACT':
|
||||||
$link='/fichinter/card.php?id='.$object->id;
|
$link='/fichinter/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->facture->dir_output;
|
$dir_output = $conf->facture->dir_output;
|
||||||
@ -409,7 +416,7 @@ class Notify
|
|||||||
break;
|
break;
|
||||||
case 'ORDER_SUPPLIER_VALIDATE':
|
case 'ORDER_SUPPLIER_VALIDATE':
|
||||||
$link='/fourn/commande/card.php?id='.$object->id;
|
$link='/fourn/commande/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||||
$object_type = 'order_supplier';
|
$object_type = 'order_supplier';
|
||||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs));
|
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$object->ref,$user->getFullName($langs));
|
||||||
@ -417,7 +424,7 @@ class Notify
|
|||||||
break;
|
break;
|
||||||
case 'ORDER_SUPPLIER_APPROVE':
|
case 'ORDER_SUPPLIER_APPROVE':
|
||||||
$link='/fourn/commande/card.php?id='.$object->id;
|
$link='/fourn/commande/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||||
$object_type = 'order_supplier';
|
$object_type = 'order_supplier';
|
||||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
||||||
@ -425,7 +432,7 @@ class Notify
|
|||||||
break;
|
break;
|
||||||
case 'ORDER_SUPPLIER_REFUSE':
|
case 'ORDER_SUPPLIER_REFUSE':
|
||||||
$link='/fourn/commande/card.php?id='.$object->id;
|
$link='/fourn/commande/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||||
$object_type = 'order_supplier';
|
$object_type = 'order_supplier';
|
||||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs));
|
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderRefusedBy",$newref,$user->getFullName($langs));
|
||||||
@ -571,6 +578,12 @@ class Notify
|
|||||||
$object_type = 'propal';
|
$object_type = 'propal';
|
||||||
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
|
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalValidated",$newref);
|
||||||
break;
|
break;
|
||||||
|
case 'PROPAL_CLOSE_SIGNED':
|
||||||
|
$link='/comm/propal/card.php?id='.$object->id;
|
||||||
|
$dir_output = $conf->propal->dir_output;
|
||||||
|
$object_type = 'propal';
|
||||||
|
$mesg = $langs->transnoentitiesnoconv("EMailTextProposalClosedSigned",$newref);
|
||||||
|
break;
|
||||||
case 'FICHINTER_ADD_CONTACT':
|
case 'FICHINTER_ADD_CONTACT':
|
||||||
$link='/fichinter/card.php?id='.$object->id;
|
$link='/fichinter/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->facture->dir_output;
|
$dir_output = $conf->facture->dir_output;
|
||||||
@ -585,7 +598,7 @@ class Notify
|
|||||||
break;
|
break;
|
||||||
case 'ORDER_SUPPLIER_VALIDATE':
|
case 'ORDER_SUPPLIER_VALIDATE':
|
||||||
$link='/fourn/commande/card.php?id='.$object->id;
|
$link='/fourn/commande/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||||
$object_type = 'order_supplier';
|
$object_type = 'order_supplier';
|
||||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($langs));
|
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderValidatedBy",$newref,$user->getFullName($langs));
|
||||||
@ -593,7 +606,7 @@ class Notify
|
|||||||
break;
|
break;
|
||||||
case 'ORDER_SUPPLIER_APPROVE':
|
case 'ORDER_SUPPLIER_APPROVE':
|
||||||
$link='/fourn/commande/card.php?id='.$object->id;
|
$link='/fourn/commande/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||||
$object_type = 'order_supplier';
|
$object_type = 'order_supplier';
|
||||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
||||||
@ -601,7 +614,7 @@ class Notify
|
|||||||
break;
|
break;
|
||||||
case 'ORDER_SUPPLIER_APPROVE2':
|
case 'ORDER_SUPPLIER_APPROVE2':
|
||||||
$link='/fourn/commande/card.php?id='.$object->id;
|
$link='/fourn/commande/card.php?id='.$object->id;
|
||||||
$dir_output = $conf->fournisseur->dir_output.'/commande/';
|
$dir_output = $conf->fournisseur->commande->dir_output;
|
||||||
$object_type = 'order_supplier';
|
$object_type = 'order_supplier';
|
||||||
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
$mesg = $langs->transnoentitiesnoconv("Hello").",\n\n";
|
||||||
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
$mesg.= $langs->transnoentitiesnoconv("EMailTextOrderApprovedBy",$newref,$user->getFullName($langs));
|
||||||
|
|||||||
@ -63,18 +63,15 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
|
|||||||
var autoselect = '.$autoselect.';
|
var autoselect = '.$autoselect.';
|
||||||
var options = '.json_encode($ajaxoptions).';
|
var options = '.json_encode($ajaxoptions).';
|
||||||
|
|
||||||
/* Remove product id before select another product use keyup instead of change to avoid loosing the product id. This is needed only for select of predefined product */
|
/* Remove selected id as soon as we type or delete a char (it means old selection is wrong). Use keyup/down instead of change to avoid loosing the product id. This is needed only for select of predefined product */
|
||||||
/* TODO Check if we can remove this */
|
$("input#search_'.$htmlname.'").keydown(function(e) {
|
||||||
$("input#search_'.$htmlname.'").keydown(function() {
|
if (e.keyCode != 9) /* If not "Tab" key */
|
||||||
|
{
|
||||||
|
console.log("Clear id previously selected for field '.$htmlname.'");
|
||||||
$("#'.$htmlname.'").val("");
|
$("#'.$htmlname.'").val("");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/* I disable this. A call to trigger is already done later into the select action of the autocomplete code
|
|
||||||
$("input#search_'.$htmlname.'").change(function() {
|
|
||||||
console.log("Call the change trigger on input '.$htmlname.' because of a change on search_'.$htmlname.' was triggered");
|
|
||||||
$("#'.$htmlname.'").trigger("change");
|
|
||||||
});*/
|
|
||||||
|
|
||||||
// Check options for secondary actions when keyup
|
// Check options for secondary actions when keyup
|
||||||
$("input#search_'.$htmlname.'").keyup(function() {
|
$("input#search_'.$htmlname.'").keyup(function() {
|
||||||
if ($(this).val().length == 0)
|
if ($(this).val().length == 0)
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2010 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2010-2012 Regis Houssin <regis.houssin@capnetworks.com>
|
* Copyright (C) 2010-2017 Regis Houssin <regis.houssin@capnetworks.com>
|
||||||
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
*
|
*
|
||||||
@ -42,7 +42,8 @@ function contact_prepare_head(Contact $object)
|
|||||||
$head[$tab][2] = 'card';
|
$head[$tab][2] = 'card';
|
||||||
$tab++;
|
$tab++;
|
||||||
|
|
||||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE))
|
if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_CONTACT_ACTIVE))
|
||||||
|
&& (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
|
||||||
{
|
{
|
||||||
$langs->load("ldap");
|
$langs->load("ldap");
|
||||||
|
|
||||||
|
|||||||
@ -1279,8 +1279,8 @@ function dol_delete_preview($object)
|
|||||||
// Define parent dir of elements
|
// Define parent dir of elements
|
||||||
$element = $object->element;
|
$element = $object->element;
|
||||||
|
|
||||||
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->dir_output.'/commande';
|
if ($object->element == 'order_supplier') $dir = $conf->fournisseur->commande->dir_output;
|
||||||
elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->dir_output.'/facture';
|
elseif ($object->element == 'invoice_supplier') $dir = $conf->fournisseur->facture->dir_output;
|
||||||
elseif ($object->element == 'project') $dir = $conf->projet->dir_output;
|
elseif ($object->element == 'project') $dir = $conf->projet->dir_output;
|
||||||
elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending';
|
elseif ($object->element == 'shipping') $dir = $conf->expedition->dir_output.'/sending';
|
||||||
elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt';
|
elseif ($object->element == 'delivery') $dir = $conf->expedition->dir_output.'/receipt';
|
||||||
@ -2083,7 +2083,7 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
|
|||||||
elseif ($modulepart == 'billstatssupplier' && !empty($conf->fournisseur->dir_output))
|
elseif ($modulepart == 'billstatssupplier' && !empty($conf->fournisseur->dir_output))
|
||||||
{
|
{
|
||||||
if ($fuser->rights->fournisseur->facture->{$lire}) $accessallowed=1;
|
if ($fuser->rights->fournisseur->facture->{$lire}) $accessallowed=1;
|
||||||
$original_file=$conf->fournisseur->dir_output.'/facture/temp/'.$original_file;
|
$original_file=$conf->fournisseur->facture->dir_temp.'/'.$original_file;
|
||||||
}
|
}
|
||||||
// Wrapping pour les images des stats expeditions
|
// Wrapping pour les images des stats expeditions
|
||||||
elseif ($modulepart == 'expeditionstats' && !empty($conf->expedition->dir_temp))
|
elseif ($modulepart == 'expeditionstats' && !empty($conf->expedition->dir_temp))
|
||||||
|
|||||||
@ -3830,7 +3830,7 @@ function vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
|
|||||||
* @param float $amount Amount to format
|
* @param float $amount Amount to format
|
||||||
* @param integer $form Type of format, HTML or not (not by default)
|
* @param integer $form Type of format, HTML or not (not by default)
|
||||||
* @param Translate $outlangs Object langs for output
|
* @param Translate $outlangs Object langs for output
|
||||||
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before inserted into database or after a computation, so this parameter should be useless.
|
* @param int $trunc 1=Truncate if there is more decimals than MAIN_MAX_DECIMALS_SHOWN (default), 0=Does not truncate. Deprecated because amount are rounded (to unit or total amount accurancy) before beeing inserted into database or after a computation, so this parameter should be useless.
|
||||||
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
|
* @param int $rounding Minimum number of decimal to show. If 0, no change, if -1, we use min($conf->global->MAIN_MAX_DECIMALS_UNIT,$conf->global->MAIN_MAX_DECIMALS_TOTAL)
|
||||||
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
* @param int $forcerounding Force the number of decimal to forcerounding decimal (-1=do not force)
|
||||||
* @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
|
* @param string $currency_code To add currency symbol (''=add nothing, 'auto'=Use default currency, 'XXX'=add currency symbols for XXX currency)
|
||||||
@ -6378,7 +6378,7 @@ function dolExplodeIntoArray($string, $delimiter = ';', $kv = '=')
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set focus onto field with selector
|
* Set focus onto field with selector (similar behaviour of 'autofocus' HTML5 tag)
|
||||||
*
|
*
|
||||||
* @param string $selector Selector ('#id' or 'input[name="ref"]') to use to find the HTML input field that must get the autofocus. You must use a CSS selector, so unique id preceding with the '#' char.
|
* @param string $selector Selector ('#id' or 'input[name="ref"]') to use to find the HTML input field that must get the autofocus. You must use a CSS selector, so unique id preceding with the '#' char.
|
||||||
* @return string HTML code to set focus
|
* @return string HTML code to set focus
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2006-2015 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
* Copyright (C) 2015-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
|
||||||
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||||
|
* Copyright (C) 2017 Regis Houssin <regis.houssin@capnetworks.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
|
||||||
@ -41,7 +42,8 @@ function member_prepare_head(Adherent $object)
|
|||||||
$head[$h][2] = 'general';
|
$head[$h][2] = 'general';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_ACTIVE))
|
||||||
|
&& (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
|
||||||
{
|
{
|
||||||
$langs->load("ldap");
|
$langs->load("ldap");
|
||||||
|
|
||||||
@ -124,7 +126,8 @@ function member_type_prepare_head(AdherentType $object)
|
|||||||
$head[$h][2] = 'card';
|
$head[$h][2] = 'card';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE))
|
if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE))
|
||||||
|
&& (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
|
||||||
{
|
{
|
||||||
$langs->load("ldap");
|
$langs->load("ldap");
|
||||||
|
|
||||||
|
|||||||
@ -663,12 +663,6 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
print $projectstatic->getNomUrl(1,'',0,$langs->transnoentitiesnoconv("YourRole").': '.$projectsrole[$lines[$i]->fk_project]);
|
||||||
print "</td>";
|
print "</td>";
|
||||||
|
|
||||||
// Ref
|
|
||||||
print '<td>';
|
|
||||||
$taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
|
|
||||||
print $taskstatic->getNomUrl(1,'withproject');
|
|
||||||
print '</td>';
|
|
||||||
|
|
||||||
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
|
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY))
|
||||||
{
|
{
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
@ -679,6 +673,12 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
print '</td>';
|
print '</td>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ref
|
||||||
|
print '<td>';
|
||||||
|
$taskstatic->ref=($lines[$i]->ref?$lines[$i]->ref:$lines[$i]->id);
|
||||||
|
print $taskstatic->getNomUrl(1, 'withproject', 'time');
|
||||||
|
print '</td>';
|
||||||
|
|
||||||
// Label task
|
// Label task
|
||||||
print "<td>";
|
print "<td>";
|
||||||
for ($k = 0 ; $k < $level ; $k++) print " ";
|
for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||||
@ -686,7 +686,7 @@ function projectLinesPerDay(&$inc, $parent, $fuser, $lines, &$level, &$projectsr
|
|||||||
$taskstatic->ref=$lines[$i]->label;
|
$taskstatic->ref=$lines[$i]->label;
|
||||||
$taskstatic->date_start=$lines[$i]->date_start;
|
$taskstatic->date_start=$lines[$i]->date_start;
|
||||||
$taskstatic->date_end=$lines[$i]->date_end;
|
$taskstatic->date_end=$lines[$i]->date_end;
|
||||||
print $taskstatic->getNomUrl(0,'withproject');
|
print $taskstatic->getNomUrl(0, 'withproject', 'time');
|
||||||
//print "<br>";
|
//print "<br>";
|
||||||
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
//for ($k = 0 ; $k < $level ; $k++) print " ";
|
||||||
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
//print get_date_range($lines[$i]->date_start,$lines[$i]->date_end,'',$langs,0);
|
||||||
|
|||||||
@ -87,7 +87,7 @@ function dol_hash($chain,$type=0)
|
|||||||
if ($type == 1) return sha1($chain);
|
if ($type == 1) return sha1($chain);
|
||||||
else if ($type == 2) return sha1(md5($chain));
|
else if ($type == 2) return sha1(md5($chain));
|
||||||
else if ($type == 3) return md5($chain);
|
else if ($type == 3) return md5($chain);
|
||||||
else if ($type == 4) return '{md5}'.base64_encode(mhash(MHASH_MD5,$chain)); // For OpenLdap with md5
|
else if ($type == 4) return '{md5}'.base64_encode(mhash(MHASH_MD5,$chain)); // For OpenLdap with md5 (based on an unencrypted password in base)
|
||||||
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
|
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1') return sha1($chain);
|
||||||
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
|
else if (! empty($conf->global->MAIN_SECURITY_HASH_ALGO) && $conf->global->MAIN_SECURITY_HASH_ALGO == 'sha1md5') return sha1(md5($chain));
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,8 @@ function user_prepare_head($object)
|
|||||||
$head[$h][2] = 'user';
|
$head[$h][2] = 'user';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE))
|
if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE))
|
||||||
|
&& (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
|
||||||
{
|
{
|
||||||
$langs->load("ldap");
|
$langs->load("ldap");
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id;
|
||||||
@ -210,7 +211,8 @@ function group_prepare_head($object)
|
|||||||
$head[$h][2] = 'group';
|
$head[$h][2] = 'group';
|
||||||
$h++;
|
$h++;
|
||||||
|
|
||||||
if (! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE))
|
if ((! empty($conf->ldap->enabled) && ! empty($conf->global->LDAP_SYNCHRO_ACTIVE))
|
||||||
|
&& (empty($conf->global->MAIN_DISABLE_LDAP_TAB) || ! empty($user->admin)))
|
||||||
{
|
{
|
||||||
$langs->load("ldap");
|
$langs->load("ldap");
|
||||||
$head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id;
|
$head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id;
|
||||||
|
|||||||
@ -157,7 +157,7 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
|
|||||||
$outputlangs->load("bills");
|
$outputlangs->load("bills");
|
||||||
$outputlangs->load("products");
|
$outputlangs->load("products");
|
||||||
|
|
||||||
if ($conf->fournisseur->dir_output.'/facture')
|
if ($conf->fournisseur->facture->dir_output)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
|||||||
@ -205,7 +205,7 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
|
|||||||
}
|
}
|
||||||
if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
|
if (count($realpatharray) == 0) $this->posxpicture=$this->posxtva;
|
||||||
|
|
||||||
if ($conf->fournisseur->dir_output.'/commande')
|
if ($conf->fournisseur->commande->dir_output)
|
||||||
{
|
{
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
|||||||
@ -52,6 +52,7 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
|||||||
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
public function runTrigger($action, $object, User $user, Translate $langs, Conf $conf)
|
||||||
{
|
{
|
||||||
if (empty($conf->ldap->enabled)) return 0; // Module not active, we do nothing
|
if (empty($conf->ldap->enabled)) return 0; // Module not active, we do nothing
|
||||||
|
if (defined('DISABLE_LDAP_SYNCHRO')) return 0; // If constant defined, we do nothing
|
||||||
|
|
||||||
if (! function_exists('ldap_connect'))
|
if (! function_exists('ldap_connect'))
|
||||||
{
|
{
|
||||||
@ -111,8 +112,10 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
|||||||
|
|
||||||
$info=$object->_load_ldap_info();
|
$info=$object->_load_ldap_info();
|
||||||
$dn=$object->_load_ldap_dn($info);
|
$dn=$object->_load_ldap_dn($info);
|
||||||
|
$newrdn=$object->_load_ldap_dn($info,2);
|
||||||
|
$newparent=$object->_load_ldap_dn($info,1);
|
||||||
|
|
||||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
$result=$ldap->update($dn,$info,$user,$olddn,$newrdn,$newparent);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
|
if ($result < 0) $this->error="ErrorLDAP ".$ldap->error;
|
||||||
@ -544,8 +547,10 @@ class InterfaceLdapsynchro extends DolibarrTriggers
|
|||||||
|
|
||||||
$info=$object->_load_ldap_info();
|
$info=$object->_load_ldap_info();
|
||||||
$dn=$object->_load_ldap_dn($info);
|
$dn=$object->_load_ldap_dn($info);
|
||||||
|
$newrdn=$object->_load_ldap_dn($info,2);
|
||||||
|
$newparent=$object->_load_ldap_dn($info,1);
|
||||||
|
|
||||||
$result=$ldap->update($dn,$info,$user,$olddn);
|
$result=$ldap->update($dn,$info,$user,$olddn,$newrdn,$newparent);
|
||||||
|
|
||||||
// For member type
|
// For member type
|
||||||
if (! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE) && (string) $conf->global->LDAP_MEMBER_TYPE_ACTIVE == '1')
|
if (! empty($conf->global->LDAP_MEMBER_TYPE_ACTIVE) && (string) $conf->global->LDAP_MEMBER_TYPE_ACTIVE == '1')
|
||||||
|
|||||||
@ -40,6 +40,7 @@ class InterfaceNotification extends DolibarrTriggers
|
|||||||
'BILL_PAYED',
|
'BILL_PAYED',
|
||||||
'ORDER_VALIDATE',
|
'ORDER_VALIDATE',
|
||||||
'PROPAL_VALIDATE',
|
'PROPAL_VALIDATE',
|
||||||
|
'PROPAL_CLOSE_SIGNED',
|
||||||
'FICHINTER_VALIDATE',
|
'FICHINTER_VALIDATE',
|
||||||
'FICHINTER_ADD_CONTACT',
|
'FICHINTER_ADD_CONTACT',
|
||||||
'ORDER_SUPPLIER_VALIDATE',
|
'ORDER_SUPPLIER_VALIDATE',
|
||||||
|
|||||||
@ -450,8 +450,8 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
// in order not to lose the attached files
|
// in order not to lose the attached files
|
||||||
$oldref = dol_sanitizeFileName($this->ref);
|
$oldref = dol_sanitizeFileName($this->ref);
|
||||||
$newref = dol_sanitizeFileName($num);
|
$newref = dol_sanitizeFileName($num);
|
||||||
$dirsource = $conf->fournisseur->dir_output.'/commande/'.$oldref;
|
$dirsource = $conf->fournisseur->commande->dir_output.'/'.$oldref;
|
||||||
$dirdest = $conf->fournisseur->dir_output.'/commande/'.$newref;
|
$dirdest = $conf->fournisseur->commande->dir_output.'/'.$newref;
|
||||||
if (file_exists($dirsource))
|
if (file_exists($dirsource))
|
||||||
{
|
{
|
||||||
dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest);
|
dol_syslog(get_class($this)."::valid rename dir ".$dirsource." into ".$dirdest);
|
||||||
@ -460,7 +460,7 @@ class CommandeFournisseur extends CommonOrder
|
|||||||
{
|
{
|
||||||
dol_syslog("Rename ok");
|
dol_syslog("Rename ok");
|
||||||
// Rename docs starting with $oldref with $newref
|
// Rename docs starting with $oldref with $newref
|
||||||
$listoffiles=dol_dir_list($conf->fournisseur->dir_output.'/commande/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
|
$listoffiles=dol_dir_list($conf->fournisseur->commande->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref,'/'));
|
||||||
foreach($listoffiles as $fileentry)
|
foreach($listoffiles as $fileentry)
|
||||||
{
|
{
|
||||||
$dirsource=$fileentry['name'];
|
$dirsource=$fileentry['name'];
|
||||||
|
|||||||
@ -703,7 +703,7 @@ class PaiementFourn extends Paiement
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$modelpath = "core/modules/supplier_payment/pdf/";
|
$modelpath = "core/modules/supplier_payment/doc/";
|
||||||
|
|
||||||
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
return $this->commonGenerateDocument($modelpath, $modele, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,7 +71,7 @@ if ($object->fetch($id,$ref) < 0)
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
$upload_dir = $conf->fournisseur->dir_output.'/commande/'.dol_sanitizeFileName($object->ref);
|
$upload_dir = $conf->fournisseur->commande->dir_output.'/'.dol_sanitizeFileName($object->ref);
|
||||||
$object->fetch_thirdparty();
|
$object->fetch_thirdparty();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1021,7 +1021,7 @@ if ($resql)
|
|||||||
// Other picto tool
|
// Other picto tool
|
||||||
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
|
||||||
$filename=dol_sanitizeFileName($obj->ref);
|
$filename=dol_sanitizeFileName($obj->ref);
|
||||||
$filedir=$conf->fournisseur->dir_output.'/commande/' . dol_sanitizeFileName($obj->ref);
|
$filedir=$conf->fournisseur->commande->dir_output.'/' . dol_sanitizeFileName($obj->ref);
|
||||||
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir);
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
|
|||||||
@ -140,30 +140,10 @@ if ($action == 'setdatep' && ! empty($_POST['datepday']))
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Build document
|
// Build document
|
||||||
if ($action == 'builddoc')
|
$upload_dir = $conf->fournisseur->payment->dir_output;
|
||||||
{
|
// TODO: get the appropriate permisson
|
||||||
// Save modele used
|
$permissioncreate = true;
|
||||||
$object->fetch($id);
|
include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
|
||||||
$object->fetch_thirdparty();
|
|
||||||
|
|
||||||
// Save last template used to generate document
|
|
||||||
if (GETPOST('model')) $object->setDocModel($user, GETPOST('model','alpha'));
|
|
||||||
|
|
||||||
$outputlangs = $langs;
|
|
||||||
$newlang=GETPOST('lang_id','aZ09');
|
|
||||||
if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->thirdparty->default_lang;
|
|
||||||
if (! empty($newlang))
|
|
||||||
{
|
|
||||||
$outputlangs = new Translate("",$conf);
|
|
||||||
$outputlangs->setDefaultLang($newlang);
|
|
||||||
}
|
|
||||||
$result = $object->generateDocument($object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
|
||||||
if ($result < 0)
|
|
||||||
{
|
|
||||||
setEventMessages($object->error, $object->errors, 'errors');
|
|
||||||
$action='';
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@ -330,6 +330,18 @@ if ($id > 0) // For user tab
|
|||||||
}
|
}
|
||||||
|
|
||||||
dol_fiche_end();
|
dol_fiche_end();
|
||||||
|
|
||||||
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
|
$canedit=(($user->id == $user_id && $user->rights->holiday->write) || ($user->id != $user_id && $user->rights->holiday->write_all));
|
||||||
|
|
||||||
|
// Boutons d'actions
|
||||||
|
if ($canedit)
|
||||||
|
{
|
||||||
|
print '<a href="'.DOL_URL_ROOT.'/holiday/card.php?action=request&fuserid='.$user_id.'" class="butAction">'.$langs->trans("AddCP").'</a>';
|
||||||
|
}
|
||||||
|
|
||||||
|
print '</div>';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -348,8 +360,6 @@ else
|
|||||||
}*/
|
}*/
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($id > 0) print '<br>';
|
|
||||||
|
|
||||||
if ($sall)
|
if ($sall)
|
||||||
{
|
{
|
||||||
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
foreach($fieldstosearchall as $key => $val) $fieldstosearchall[$key]=$langs->trans($val);
|
||||||
|
|||||||
@ -41,6 +41,8 @@ ALTER TABLE llx_website_page ADD COLUMN fk_user_modif integer;
|
|||||||
|
|
||||||
-- For 7.0
|
-- For 7.0
|
||||||
|
|
||||||
|
ALTER TABLE llx_user ADD COLUMN birth date;
|
||||||
|
|
||||||
-- VMYSQL4.1 ALTER TABLE llx_holiday_users DROP PRIMARY KEY;
|
-- VMYSQL4.1 ALTER TABLE llx_holiday_users DROP PRIMARY KEY;
|
||||||
|
|
||||||
ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type, nb_holiday);
|
ALTER TABLE llx_holiday_users ADD UNIQUE INDEX uk_holiday_users(fk_user, fk_type, nb_holiday);
|
||||||
|
|||||||
@ -364,6 +364,8 @@ update llx_bank_url as bu set url_id = (select e.fk_user_author from tmp_bank_ur
|
|||||||
drop table tmp_bank_url_expense_user;
|
drop table tmp_bank_url_expense_user;
|
||||||
|
|
||||||
|
|
||||||
|
-- VMYSQL4.1 update llx_projet_task_time set task_datehour = task_date where task_datehour < task_date or task_datehour > DATE_ADD(task_date, interval 1 day);
|
||||||
|
|
||||||
|
|
||||||
-- Clean product prices
|
-- Clean product prices
|
||||||
--delete from llx_product_price where date_price between '2017-04-20 06:51:00' and '2017-04-20 06:51:05';
|
--delete from llx_product_price where date_price between '2017-04-20 06:51:00' and '2017-04-20 06:51:05';
|
||||||
|
|||||||
@ -47,6 +47,7 @@ create table llx_user
|
|||||||
town varchar(50), -- town
|
town varchar(50), -- town
|
||||||
fk_state integer DEFAULT 0, --
|
fk_state integer DEFAULT 0, --
|
||||||
fk_country integer DEFAULT 0, --
|
fk_country integer DEFAULT 0, --
|
||||||
|
birth date, -- birthday
|
||||||
job varchar(128),
|
job varchar(128),
|
||||||
skype varchar(255),
|
skype varchar(255),
|
||||||
office_phone varchar(20),
|
office_phone varchar(20),
|
||||||
|
|||||||
@ -81,3 +81,4 @@ HooksDefDesc=Define in the <b>module_parts['hooks']</b> property, in the module
|
|||||||
TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed.
|
TriggerDefDesc=Define in the trigger file the code you want to execute for each business event executed.
|
||||||
SeeIDsInUse=See IDs in use in your installation
|
SeeIDsInUse=See IDs in use in your installation
|
||||||
SeeReservedIDsRangeHere=See range of reserved IDs
|
SeeReservedIDsRangeHere=See range of reserved IDs
|
||||||
|
ToolkitForDevelopers=Toolkit for Dolibarr developers
|
||||||
@ -186,6 +186,7 @@ EMailTextInterventionAddedContact=A newintervention %s has been assigned to you.
|
|||||||
EMailTextInterventionValidated=The intervention %s has been validated.
|
EMailTextInterventionValidated=The intervention %s has been validated.
|
||||||
EMailTextInvoiceValidated=The invoice %s has been validated.
|
EMailTextInvoiceValidated=The invoice %s has been validated.
|
||||||
EMailTextProposalValidated=The proposal %s has been validated.
|
EMailTextProposalValidated=The proposal %s has been validated.
|
||||||
|
EMailTextProposalClosedSigned=The proposal %s has been closed signed.
|
||||||
EMailTextOrderValidated=The order %s has been validated.
|
EMailTextOrderValidated=The order %s has been validated.
|
||||||
EMailTextOrderApproved=The order %s has been approved.
|
EMailTextOrderApproved=The order %s has been approved.
|
||||||
EMailTextOrderValidatedBy=The order %s has been recorded by %s.
|
EMailTextOrderValidatedBy=The order %s has been recorded by %s.
|
||||||
|
|||||||
@ -96,7 +96,8 @@ HierarchicView=Hierarchical view
|
|||||||
UseTypeFieldToChange=Use field Type to change
|
UseTypeFieldToChange=Use field Type to change
|
||||||
OpenIDURL=OpenID URL
|
OpenIDURL=OpenID URL
|
||||||
LoginUsingOpenID=Use OpenID to login
|
LoginUsingOpenID=Use OpenID to login
|
||||||
WeeklyHours=Weekly hours
|
WeeklyHours=Hours worked (per week)
|
||||||
|
ExpectedWorkedHours=Expected worked hours per week
|
||||||
ColorUser=Color of the user
|
ColorUser=Color of the user
|
||||||
DisabledInMonoUserMode=Disabled in maintenance mode
|
DisabledInMonoUserMode=Disabled in maintenance mode
|
||||||
UserAccountancyCode=User accounting code
|
UserAccountancyCode=User accounting code
|
||||||
|
|||||||
@ -180,6 +180,7 @@ EMailTextInterventionAddedContact=Une nouvelle intervention %s vous a été assi
|
|||||||
EMailTextInterventionValidated=La fiche intervention %s vous concernant a été validée.
|
EMailTextInterventionValidated=La fiche intervention %s vous concernant a été validée.
|
||||||
EMailTextInvoiceValidated=La facture %s vous concernant a été validée.
|
EMailTextInvoiceValidated=La facture %s vous concernant a été validée.
|
||||||
EMailTextProposalValidated=La proposition commerciale %s vous concernant a été validée.
|
EMailTextProposalValidated=La proposition commerciale %s vous concernant a été validée.
|
||||||
|
EMailTextProposalClosedSigned=La proposition commerciale %s a été fermée signée.
|
||||||
EMailTextOrderValidated=La commande %s vous concernant a été validée.
|
EMailTextOrderValidated=La commande %s vous concernant a été validée.
|
||||||
EMailTextOrderApproved=La commande %s a été approuvée.
|
EMailTextOrderApproved=La commande %s a été approuvée.
|
||||||
EMailTextOrderValidatedBy=La commande %s a été enregistrée par %s
|
EMailTextOrderValidatedBy=La commande %s a été enregistrée par %s
|
||||||
|
|||||||
@ -108,7 +108,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$search_categ='';
|
$search_categ='';
|
||||||
$search_usertoprocessid = '';
|
$search_usertoprocessid = $user->id;
|
||||||
$search_task_ref = '';
|
$search_task_ref = '';
|
||||||
$search_task_label = '';
|
$search_task_label = '';
|
||||||
$search_project_ref = '';
|
$search_project_ref = '';
|
||||||
@ -242,13 +242,14 @@ if ($action == 'addtime' && $user->rights->projet->lire)
|
|||||||
$object->timespent_note = GETPOST($key.'note');
|
$object->timespent_note = GETPOST($key.'note');
|
||||||
if (GETPOST($key."hour") != '' && GETPOST($key."hour") >= 0) // If hour was entered
|
if (GETPOST($key."hour") != '' && GETPOST($key."hour") >= 0) // If hour was entered
|
||||||
{
|
{
|
||||||
$object->timespent_date = dol_mktime(GETPOST($key."hour"),GETPOST($key."min"),0,$monthofday,$dayofday,$yearofday);
|
$object->timespent_datehour = dol_mktime(GETPOST($key."hour"),GETPOST($key."min"),0,$monthofday,$dayofday,$yearofday);
|
||||||
$object->timespent_withhour = 1;
|
$object->timespent_withhour = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
$object->timespent_date = dol_mktime(12,0,0,$monthofday,$dayofday,$yearofday);
|
$object->timespent_datehour = dol_mktime(12,0,0,$monthofday,$dayofday,$yearofday);
|
||||||
}
|
}
|
||||||
|
$object->timespent_date = $object->timespent_datehour;
|
||||||
|
|
||||||
if ($object->timespent_date > 0)
|
if ($object->timespent_date > 0)
|
||||||
{
|
{
|
||||||
@ -501,7 +502,10 @@ if (count($tasksarray) > 0)
|
|||||||
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) $colspan++;
|
if (! empty($conf->global->PROJECT_LINES_PERDAY_SHOW_THIRDPARTY)) $colspan++;
|
||||||
|
|
||||||
print '<tr class="liste_total">
|
print '<tr class="liste_total">
|
||||||
<td class="liste_total" colspan="'.$colspan.'">'.$langs->trans("Total").'</td>
|
<td class="liste_total" colspan="'.$colspan.'">';
|
||||||
|
print $langs->trans("Total");
|
||||||
|
//print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
|
||||||
|
print '</td>
|
||||||
<td class="liste_total hide0" align="center"><div id="totalDay[0]"> </div></td>
|
<td class="liste_total hide0" align="center"><div id="totalDay[0]"> </div></td>
|
||||||
<td class="liste_total"></td>
|
<td class="liste_total"></td>
|
||||||
<td class="liste_total"></td>
|
<td class="liste_total"></td>
|
||||||
@ -526,7 +530,7 @@ $modeinput='hours';
|
|||||||
|
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print "jQuery(document).ready(function () {\n";
|
print "jQuery(document).ready(function () {\n";
|
||||||
print ' jQuery(".timesheetalreadyrecorded").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50, content: \''.dol_escape_js($langs->trans("TimeAlreadyRecorded", $user->getFullName($langs))).'\'});';
|
print ' jQuery(".timesheetalreadyrecorded").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50, content: \''.dol_escape_js($langs->trans("TimeAlreadyRecorded", $usertoprocess->getFullName($langs))).'\'});';
|
||||||
print ' updateTotal(0,\''.$modeinput.'\');';
|
print ' updateTotal(0,\''.$modeinput.'\');';
|
||||||
print "});";
|
print "});";
|
||||||
print '</script>';
|
print '</script>';
|
||||||
|
|||||||
@ -121,7 +121,7 @@ if (GETPOST('button_removefilter_x','alpha') || GETPOST('button_removefilter.x',
|
|||||||
{
|
{
|
||||||
$action = '';
|
$action = '';
|
||||||
$search_categ='';
|
$search_categ='';
|
||||||
$search_usertoprocessid = '';
|
$search_usertoprocessid = $user->id;
|
||||||
$search_task_ref = '';
|
$search_task_ref = '';
|
||||||
$search_task_label = '';
|
$search_task_label = '';
|
||||||
$search_project_ref = '';
|
$search_project_ref = '';
|
||||||
@ -247,6 +247,7 @@ if ($action == 'addtime' && $user->rights->projet->lire)
|
|||||||
$object->timespent_duration = $newduration;
|
$object->timespent_duration = $newduration;
|
||||||
$object->timespent_fk_user = $usertoprocess->id;
|
$object->timespent_fk_user = $usertoprocess->id;
|
||||||
$object->timespent_date = dol_time_plus_duree($firstdaytoshow, $key, 'd');
|
$object->timespent_date = dol_time_plus_duree($firstdaytoshow, $key, 'd');
|
||||||
|
$object->timespent_datehour = $object->timespent_date;
|
||||||
|
|
||||||
$result=$object->addTimeSpent($user);
|
$result=$object->addTimeSpent($user);
|
||||||
if ($result < 0)
|
if ($result < 0)
|
||||||
@ -514,7 +515,10 @@ if (count($tasksarray) > 0)
|
|||||||
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) $colspan++;
|
if (! empty($conf->global->PROJECT_LINES_PERWEEK_SHOW_THIRDPARTY)) $colspan++;
|
||||||
|
|
||||||
print '<tr class="liste_total">
|
print '<tr class="liste_total">
|
||||||
<td class="liste_total" colspan="'.$colspan.'">'.$langs->trans("Total").'</td>
|
<td class="liste_total" colspan="'.$colspan.'">';
|
||||||
|
print $langs->trans("Total");
|
||||||
|
print ' - '.$langs->trans("ExpectedWorkedHours").': <strong>'.price($usertoprocess->weeklyhours, 1, $langs, 0, 0).'</strong>';
|
||||||
|
print '</td>
|
||||||
<td class="liste_total hide0" align="center"><div id="totalDay[0]"> </div></td>
|
<td class="liste_total hide0" align="center"><div id="totalDay[0]"> </div></td>
|
||||||
<td class="liste_total hide1" align="center"><div id="totalDay[1]"> </div></td>
|
<td class="liste_total hide1" align="center"><div id="totalDay[1]"> </div></td>
|
||||||
<td class="liste_total hide2" align="center"><div id="totalDay[2]"> </div></td>
|
<td class="liste_total hide2" align="center"><div id="totalDay[2]"> </div></td>
|
||||||
@ -544,7 +548,7 @@ $modeinput='hours';
|
|||||||
|
|
||||||
print '<script type="text/javascript">';
|
print '<script type="text/javascript">';
|
||||||
print "jQuery(document).ready(function () {\n";
|
print "jQuery(document).ready(function () {\n";
|
||||||
print ' jQuery(".timesheetalreadyrecorded").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50, content: \''.dol_escape_js($langs->trans("TimeAlreadyRecorded", $user->getFullName($langs))).'\'});';
|
print ' jQuery(".timesheetalreadyrecorded").tipTip({ maxWidth: "600px", edgeOffset: 10, delay: 50, fadeIn: 50, fadeOut: 50, content: \''.dol_escape_js($langs->trans("TimeAlreadyRecorded", $usertoprocess->getFullName($langs))).'\'});';
|
||||||
$i=0;
|
$i=0;
|
||||||
while ($i < 7)
|
while ($i < 7)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -511,12 +511,12 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
|
|
||||||
// Ref
|
// Ref
|
||||||
$suggestedref=($_POST["ref"]?$_POST["ref"]:$defaultref);
|
$suggestedref=($_POST["ref"]?$_POST["ref"]:$defaultref);
|
||||||
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td><input size="12" type="text" name="ref" value="'.$suggestedref.'">';
|
print '<tr><td class="titlefieldcreate"><span class="fieldrequired">'.$langs->trans("Ref").'</span></td><td><input size="12" type="text" name="ref" value="'.dol_escape_htmltag($suggestedref).'">';
|
||||||
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
|
print ' '.$form->textwithpicto('', $langs->trans("YouCanCompleteRef", $suggestedref));
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
// Label
|
// Label
|
||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td><td><input size="80" type="text" name="title" value="'.GETPOST("title",'none').'"></td></tr>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Label").'</span></td><td><input size="80" type="text" name="title" value="'.dol_escape_htmltag(GETPOST("title",'none')).'" autofocus></td></tr>';
|
||||||
|
|
||||||
// Thirdparty
|
// Thirdparty
|
||||||
if ($conf->societe->enabled)
|
if ($conf->societe->enabled)
|
||||||
@ -576,20 +576,20 @@ if ($action == 'create' && $user->rights->projet->creer)
|
|||||||
|
|
||||||
// Opportunity probability
|
// Opportunity probability
|
||||||
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td>';
|
print '<tr><td>'.$langs->trans("OpportunityProbability").'</td>';
|
||||||
print '<td><input size="5" type="text" id="opp_percent" name="opp_percent" value="'.(GETPOST('opp_percent')!=''?GETPOST('opp_percent'):'').'"><span class="hideonsmartphone"> %</span>';
|
print '<td><input size="5" type="text" id="opp_percent" name="opp_percent" value="'.dol_escape_htmltag(GETPOST('opp_percent')!=''?GETPOST('opp_percent'):'').'"><span class="hideonsmartphone"> %</span>';
|
||||||
print '<input type="hidden" name="opp_percent_not_set" id="opp_percent_not_set" value="'.(GETPOST('opp_percent')!=''?'0':'1').'">';
|
print '<input type="hidden" name="opp_percent_not_set" id="opp_percent_not_set" value="'.dol_escape_htmltag(GETPOST('opp_percent')!=''?'0':'1').'">';
|
||||||
print '</td>';
|
print '</td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Opportunity amount
|
// Opportunity amount
|
||||||
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td>';
|
print '<tr><td>'.$langs->trans("OpportunityAmount").'</td>';
|
||||||
print '<td><input size="5" type="text" name="opp_amount" value="'.(GETPOST('opp_amount')!=''?GETPOST('opp_amount'):'').'"></td>';
|
print '<td><input size="5" type="text" name="opp_amount" value="'.dol_escape_htmltag(GETPOST('opp_amount')!=''?GETPOST('opp_amount'):'').'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Budget
|
// Budget
|
||||||
print '<tr><td>'.$langs->trans("Budget").'</td>';
|
print '<tr><td>'.$langs->trans("Budget").'</td>';
|
||||||
print '<td><input size="5" type="text" name="budget_amount" value="'.(GETPOST('budget_amount')!=''?GETPOST('budget_amount'):'').'"></td>';
|
print '<td><input size="5" type="text" name="budget_amount" value="'.dol_escape_htmltag(GETPOST('budget_amount')!=''?GETPOST('budget_amount'):'').'"></td>';
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
|
|
||||||
// Description
|
// Description
|
||||||
|
|||||||
@ -685,7 +685,9 @@ class Task extends CommonObject
|
|||||||
//print $usert.'-'.$userp.'-'.$projectid.'-'.$socid.'-'.$mode.'<br>';
|
//print $usert.'-'.$userp.'-'.$projectid.'-'.$socid.'-'.$mode.'<br>';
|
||||||
|
|
||||||
// List of tasks (does not care about permissions. Filtering will be done later)
|
// List of tasks (does not care about permissions. Filtering will be done later)
|
||||||
$sql = "SELECT p.rowid as projectid, p.ref, p.title as plabel, p.public, p.fk_statut as projectstatus,";
|
$sql = "SELECT ";
|
||||||
|
if ($filteronprojuser > 0 || $filterontaskuser > 0) $sql.= " DISTINCT"; // We may get several time the same record if user has several roles on same project/task
|
||||||
|
$sql.= " p.rowid as projectid, p.ref, p.title as plabel, p.public, p.fk_statut as projectstatus,";
|
||||||
$sql.= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut as status,";
|
$sql.= " t.rowid as taskid, t.ref as taskref, t.label, t.description, t.fk_task_parent, t.duration_effective, t.progress, t.fk_statut as status,";
|
||||||
$sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,";
|
$sql.= " t.dateo as date_start, t.datee as date_end, t.planned_workload, t.rang,";
|
||||||
$sql.= " s.rowid as thirdparty_id, s.nom as thirdparty_name";
|
$sql.= " s.rowid as thirdparty_id, s.nom as thirdparty_name";
|
||||||
@ -749,7 +751,7 @@ class Task extends CommonObject
|
|||||||
}
|
}
|
||||||
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
if ($socid) $sql.= " AND p.fk_soc = ".$socid;
|
||||||
if ($projectid) $sql.= " AND p.rowid in (".$projectid.")";
|
if ($projectid) $sql.= " AND p.rowid in (".$projectid.")";
|
||||||
if ($filteronprojref) $sql.= " AND p.ref LIKE '%".$filteronprojref."%'";
|
if ($filteronprojref) $sql.= " AND p.ref LIKE '%".$this->db->escape($filteronprojref)."%'";
|
||||||
if ($filteronprojstatus > -1) $sql.= " AND p.fk_statut = ".$filteronprojstatus;
|
if ($filteronprojstatus > -1) $sql.= " AND p.fk_statut = ".$filteronprojstatus;
|
||||||
if ($morewherefilter) $sql.=$morewherefilter;
|
if ($morewherefilter) $sql.=$morewherefilter;
|
||||||
$sql.= " ORDER BY p.ref, t.rang, t.dateo";
|
$sql.= " ORDER BY p.ref, t.rang, t.dateo";
|
||||||
|
|||||||
@ -45,7 +45,6 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
|
||||||
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
if (! empty($conf->ldap->enabled)) require_once DOL_DOCUMENT_ROOT.'/core/class/ldap.class.php';
|
||||||
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
if (! empty($conf->adherent->enabled)) require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
||||||
if (! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php');
|
|
||||||
if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
if (! empty($conf->categorie->enabled)) require_once DOL_DOCUMENT_ROOT.'/categories/class/categorie.class.php';
|
||||||
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php';
|
if (!empty($conf->global->MAIN_USE_EXPENSE_IK)) require_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport_ik.class.php';
|
||||||
|
|
||||||
@ -197,6 +196,8 @@ if (empty($reshook)) {
|
|||||||
$object->login = GETPOST("login", 'alpha');
|
$object->login = GETPOST("login", 'alpha');
|
||||||
$object->api_key = GETPOST("api_key", 'alpha');
|
$object->api_key = GETPOST("api_key", 'alpha');
|
||||||
$object->gender = GETPOST("gender", 'alpha');
|
$object->gender = GETPOST("gender", 'alpha');
|
||||||
|
$birth = dol_mktime(0, 0, 0, GETPOST('birthmonth'), GETPOST('birthday'), GETPOST('birthyear'));
|
||||||
|
$object->birth = $birth;
|
||||||
$object->admin = GETPOST("admin", 'alpha');
|
$object->admin = GETPOST("admin", 'alpha');
|
||||||
$object->address = GETPOST('address', 'alpha');
|
$object->address = GETPOST('address', 'alpha');
|
||||||
$object->zip = GETPOST('zipcode', 'alpha');
|
$object->zip = GETPOST('zipcode', 'alpha');
|
||||||
@ -289,10 +290,10 @@ if (empty($reshook)) {
|
|||||||
|
|
||||||
$object->fetch($id);
|
$object->fetch($id);
|
||||||
if ($action == 'addgroup') {
|
if ($action == 'addgroup') {
|
||||||
$object->SetInGroup($group, (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? GETPOST('entity', 'int') : $editgroup->entity));
|
$result = $object->SetInGroup($group, (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? GETPOST('entity', 'int') : $editgroup->entity));
|
||||||
}
|
}
|
||||||
if ($action == 'removegroup') {
|
if ($action == 'removegroup') {
|
||||||
$object->RemoveFromGroup($group, (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? GETPOST('entity', 'int') : $editgroup->entity));
|
$result = $object->RemoveFromGroup($group, (! empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) ? GETPOST('entity', 'int') : $editgroup->entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($result > 0) {
|
if ($result > 0) {
|
||||||
@ -337,6 +338,8 @@ if (empty($reshook)) {
|
|||||||
$object->firstname = GETPOST("firstname", 'alpha');
|
$object->firstname = GETPOST("firstname", 'alpha');
|
||||||
$object->login = GETPOST("login", 'alpha');
|
$object->login = GETPOST("login", 'alpha');
|
||||||
$object->gender = GETPOST("gender", 'alpha');
|
$object->gender = GETPOST("gender", 'alpha');
|
||||||
|
$birth = dol_mktime(0, 0, 0, GETPOST('birthmonth'), GETPOST('birthday'), GETPOST('birthyear'));
|
||||||
|
$object->birth = $birth;
|
||||||
$object->pass = GETPOST("password");
|
$object->pass = GETPOST("password");
|
||||||
$object->api_key = (GETPOST("api_key", 'alpha')) ? GETPOST("api_key", 'alpha') : $object->api_key;
|
$object->api_key = (GETPOST("api_key", 'alpha')) ? GETPOST("api_key", 'alpha') : $object->api_key;
|
||||||
if (! empty($user->admin)) $object->admin = GETPOST("admin"); // admin flag can only be set/unset by an admin user. A test is also done later when forging sql request
|
if (! empty($user->admin)) $object->admin = GETPOST("admin"); // admin flag can only be set/unset by an admin user. A test is also done later when forging sql request
|
||||||
@ -791,6 +794,13 @@ if ($action == 'create' || $action == 'adduserldap')
|
|||||||
print $form->selectarray('gender', $arraygender, GETPOST('gender'), 1);
|
print $form->selectarray('gender', $arraygender, GETPOST('gender'), 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Date employment
|
||||||
|
print '<tr><td>'.$langs->trans("DateToBirth").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
echo $form->select_date(GETPOST('birth'),'birth',0,0,1,'createuser',1,0,1);
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
|
print '<tr><td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
@ -1366,6 +1376,13 @@ else
|
|||||||
if ($object->gender) print $langs->trans("Gender".$object->gender);
|
if ($object->gender) print $langs->trans("Gender".$object->gender);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Date of birth
|
||||||
|
print '<tr><td>'.$langs->trans("DateToBirth").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
print dol_print_date($object->birth, 'day');
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
// API key
|
// API key
|
||||||
if(! empty($conf->api->enabled) && $user->admin) {
|
if(! empty($conf->api->enabled) && $user->admin) {
|
||||||
print '<tr><td>'.$langs->trans("ApiKey").'</td>';
|
print '<tr><td>'.$langs->trans("ApiKey").'</td>';
|
||||||
@ -2004,6 +2021,13 @@ else
|
|||||||
print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1);
|
print $form->selectarray('gender', $arraygender, GETPOST('gender')?GETPOST('gender'):$object->gender, 1);
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
|
|
||||||
|
// Date birth
|
||||||
|
print '<tr><td>'.$langs->trans("DateToBirth").'</td>';
|
||||||
|
print '<td>';
|
||||||
|
echo $form->select_date(GETPOST('birth')?GETPOST('birth'):$object->birth,'birth',0,0,1,'updateuser',1,0,1);
|
||||||
|
print '</td>';
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
// Login
|
// Login
|
||||||
print "<tr>".'<td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
|
print "<tr>".'<td><span class="fieldrequired">'.$langs->trans("Login").'</span></td>';
|
||||||
print '<td>';
|
print '<td>';
|
||||||
|
|||||||
@ -47,6 +47,7 @@ class User extends CommonObject
|
|||||||
public $search_sid;
|
public $search_sid;
|
||||||
public $employee;
|
public $employee;
|
||||||
public $gender;
|
public $gender;
|
||||||
|
public $birth;
|
||||||
public $email;
|
public $email;
|
||||||
public $skype;
|
public $skype;
|
||||||
public $job;
|
public $job;
|
||||||
@ -179,7 +180,7 @@ class User extends CommonObject
|
|||||||
$login=trim($login);
|
$login=trim($login);
|
||||||
|
|
||||||
// Get user
|
// Get user
|
||||||
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,";
|
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.employee, u.gender, u.birth, u.email, u.job, u.skype, u.signature, u.office_phone, u.office_fax, u.user_mobile,";
|
||||||
$sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,";
|
$sql.= " u.address, u.zip, u.town, u.fk_state as state_id, u.fk_country as country_id,";
|
||||||
$sql.= " u.admin, u.login, u.note,";
|
$sql.= " u.admin, u.login, u.note,";
|
||||||
$sql.= " u.pass, u.pass_crypted, u.pass_temp, u.api_key,";
|
$sql.= " u.pass, u.pass_crypted, u.pass_temp, u.api_key,";
|
||||||
@ -260,6 +261,7 @@ class User extends CommonObject
|
|||||||
|
|
||||||
$this->login = $obj->login;
|
$this->login = $obj->login;
|
||||||
$this->gender = $obj->gender;
|
$this->gender = $obj->gender;
|
||||||
|
$this->birth = $this->db->jdate($obj->birth);
|
||||||
$this->pass_indatabase = $obj->pass;
|
$this->pass_indatabase = $obj->pass;
|
||||||
$this->pass_indatabase_crypted = $obj->pass_crypted;
|
$this->pass_indatabase_crypted = $obj->pass_crypted;
|
||||||
$this->pass = $obj->pass;
|
$this->pass = $obj->pass;
|
||||||
@ -1341,6 +1343,7 @@ class User extends CommonObject
|
|||||||
$this->employee = $this->employee?$this->employee:0;
|
$this->employee = $this->employee?$this->employee:0;
|
||||||
$this->login = trim($this->login);
|
$this->login = trim($this->login);
|
||||||
$this->gender = trim($this->gender);
|
$this->gender = trim($this->gender);
|
||||||
|
$this->birth = trim($this->birth);
|
||||||
$this->pass = trim($this->pass);
|
$this->pass = trim($this->pass);
|
||||||
$this->api_key = trim($this->api_key);
|
$this->api_key = trim($this->api_key);
|
||||||
$this->address = $this->address?trim($this->address):trim($this->address);
|
$this->address = $this->address?trim($this->address):trim($this->address);
|
||||||
@ -1389,6 +1392,7 @@ class User extends CommonObject
|
|||||||
$sql.= ", login = '".$this->db->escape($this->login)."'";
|
$sql.= ", login = '".$this->db->escape($this->login)."'";
|
||||||
$sql.= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null");
|
$sql.= ", api_key = ".($this->api_key ? "'".$this->db->escape($this->api_key)."'" : "null");
|
||||||
$sql.= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman'
|
$sql.= ", gender = ".($this->gender != -1 ? "'".$this->db->escape($this->gender)."'" : "null"); // 'man' or 'woman'
|
||||||
|
$sql.= ", birth=".(strval($this->birth)!='' ? "'".$this->db->idate($this->birth)."'" : 'null');
|
||||||
if (! empty($user->admin)) $sql.= ", admin = ".$this->admin; // admin flag can be set/unset only by an admin user
|
if (! empty($user->admin)) $sql.= ", admin = ".$this->admin; // admin flag can be set/unset only by an admin user
|
||||||
$sql.= ", address = '".$this->db->escape($this->address)."'";
|
$sql.= ", address = '".$this->db->escape($this->address)."'";
|
||||||
$sql.= ", zip = '".$this->db->escape($this->zip)."'";
|
$sql.= ", zip = '".$this->db->escape($this->zip)."'";
|
||||||
@ -1470,6 +1474,7 @@ class User extends CommonObject
|
|||||||
$adh->lastname=$this->lastname;
|
$adh->lastname=$this->lastname;
|
||||||
$adh->login=$this->login;
|
$adh->login=$this->login;
|
||||||
$adh->gender=$this->gender;
|
$adh->gender=$this->gender;
|
||||||
|
$adh->birth=$this->birth;
|
||||||
|
|
||||||
$adh->pass=$this->pass;
|
$adh->pass=$this->pass;
|
||||||
|
|
||||||
@ -2262,8 +2267,8 @@ class User extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param array $info Info array loaded by _load_ldap_info
|
* @param array $info Info array loaded by _load_ldap_info
|
||||||
* @param int $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
|
* @param int $mode 0=Return full DN (uid=qqq,ou=xxx,dc=aaa,dc=bbb)
|
||||||
* 1=
|
* 1=Return parent (ou=xxx,dc=aaa,dc=bbb)
|
||||||
* 2=Return key only (uid=qqq)
|
* 2=Return key only (RDN) (uid=qqq)
|
||||||
* @return string DN
|
* @return string DN
|
||||||
*/
|
*/
|
||||||
function _load_ldap_dn($info,$mode=0)
|
function _load_ldap_dn($info,$mode=0)
|
||||||
@ -2286,40 +2291,83 @@ class User extends CommonObject
|
|||||||
global $conf,$langs;
|
global $conf,$langs;
|
||||||
|
|
||||||
$info=array();
|
$info=array();
|
||||||
|
$keymodified=false;
|
||||||
|
|
||||||
// Object classes
|
// Object classes
|
||||||
$info["objectclass"]=explode(',',$conf->global->LDAP_USER_OBJECT_CLASS);
|
$info["objectclass"]=explode(',',$conf->global->LDAP_USER_OBJECT_CLASS);
|
||||||
|
|
||||||
$this->fullname=$this->getFullName($langs);
|
$this->fullname=$this->getFullName($langs);
|
||||||
|
|
||||||
// Champs
|
// Possible LDAP KEY (constname => varname)
|
||||||
if ($this->fullname && ! empty($conf->global->LDAP_FIELD_FULLNAME)) $info[$conf->global->LDAP_FIELD_FULLNAME] = $this->fullname;
|
$ldapkey = array(
|
||||||
if ($this->lastname && ! empty($conf->global->LDAP_FIELD_NAME)) $info[$conf->global->LDAP_FIELD_NAME] = $this->lastname;
|
'LDAP_FIELD_FULLNAME' => 'fullname',
|
||||||
if ($this->firstname && ! empty($conf->global->LDAP_FIELD_FIRSTNAME)) $info[$conf->global->LDAP_FIELD_FIRSTNAME] = $this->firstname;
|
'LDAP_FIELD_NAME' => 'lastname',
|
||||||
if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN)) $info[$conf->global->LDAP_FIELD_LOGIN] = $this->login;
|
'LDAP_FIELD_FIRSTNAME' => 'firstname',
|
||||||
if ($this->login && ! empty($conf->global->LDAP_FIELD_LOGIN_SAMBA)) $info[$conf->global->LDAP_FIELD_LOGIN_SAMBA] = $this->login;
|
'LDAP_FIELD_LOGIN' => 'login',
|
||||||
if ($this->pass && ! empty($conf->global->LDAP_FIELD_PASSWORD)) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
'LDAP_FIELD_LOGIN_SAMBA' => 'login',
|
||||||
if ($this->pass && ! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // md5 for OpenLdap TODO add type of encryption
|
'LDAP_FIELD_PHONE' => 'office_phone',
|
||||||
if ($this->ldap_sid && ! empty($conf->global->LDAP_FIELD_SID)) $info[$conf->global->LDAP_FIELD_SID] = $this->ldap_sid;
|
'LDAP_FIELD_MOBILE' => 'user_mobile',
|
||||||
if ($this->societe_id > 0)
|
'LDAP_FIELD_FAX' => 'office_fax',
|
||||||
{
|
'LDAP_FIELD_MAIL' => 'email',
|
||||||
$soc = new Societe($this->db);
|
'LDAP_FIELD_SID' => 'ldap_sid',
|
||||||
$soc->fetch($this->societe_id);
|
'LDAP_FIELD_SKYPE' => 'skype'
|
||||||
|
);
|
||||||
|
|
||||||
$info["o"] = $soc->lastname;
|
// Champs
|
||||||
if ($soc->client == 1) $info["businessCategory"] = "Customers";
|
foreach ($ldapkey as $constname => $varname)
|
||||||
if ($soc->client == 2) $info["businessCategory"] = "Prospects";
|
{
|
||||||
if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers";
|
if (! empty($this->$varname) && ! empty($conf->global->$constname))
|
||||||
|
{
|
||||||
|
$info[$conf->global->$constname] = $this->$varname;
|
||||||
|
|
||||||
|
// Check if it is the LDAP key and if its value has been changed
|
||||||
|
if (! empty($conf->global->LDAP_KEY_USERS) && $conf->global->LDAP_KEY_USERS == $conf->global->$constname)
|
||||||
|
{
|
||||||
|
if (! empty($this->oldcopy) && $this->$varname != $this->oldcopy->$varname) $keymodified=true; // For check if LDAP key has been modified
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ($this->address && ! empty($conf->global->LDAP_FIELD_ADDRESS)) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address;
|
if ($this->address && ! empty($conf->global->LDAP_FIELD_ADDRESS)) $info[$conf->global->LDAP_FIELD_ADDRESS] = $this->address;
|
||||||
if ($this->zip && ! empty($conf->global->LDAP_FIELD_ZIP)) $info[$conf->global->LDAP_FIELD_ZIP] = $this->zip;
|
if ($this->zip && ! empty($conf->global->LDAP_FIELD_ZIP)) $info[$conf->global->LDAP_FIELD_ZIP] = $this->zip;
|
||||||
if ($this->town && ! empty($conf->global->LDAP_FIELD_TOWN)) $info[$conf->global->LDAP_FIELD_TOWN] = $this->town;
|
if ($this->town && ! empty($conf->global->LDAP_FIELD_TOWN)) $info[$conf->global->LDAP_FIELD_TOWN] = $this->town;
|
||||||
if ($this->office_phone && ! empty($conf->global->LDAP_FIELD_PHONE)) $info[$conf->global->LDAP_FIELD_PHONE] = $this->office_phone;
|
if ($this->note_public && ! empty($conf->global->LDAP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note_public;
|
||||||
if ($this->user_mobile && ! empty($conf->global->LDAP_FIELD_MOBILE)) $info[$conf->global->LDAP_FIELD_MOBILE] = $this->user_mobile;
|
if ($this->socid > 0)
|
||||||
if ($this->office_fax && ! empty($conf->global->LDAP_FIELD_FAX)) $info[$conf->global->LDAP_FIELD_FAX] = $this->office_fax;
|
{
|
||||||
if ($this->note && ! empty($conf->global->LDAP_FIELD_DESCRIPTION)) $info[$conf->global->LDAP_FIELD_DESCRIPTION] = $this->note;
|
$soc = new Societe($this->db);
|
||||||
if ($this->email && ! empty($conf->global->LDAP_FIELD_MAIL)) $info[$conf->global->LDAP_FIELD_MAIL] = $this->email;
|
$soc->fetch($this->socid);
|
||||||
if ($this->skype && ! empty($conf->global->LDAP_FIELD_SKYPE)) $info[$conf->global->LDAP_FIELD_SKYPE] = $this->skype;
|
|
||||||
|
$info[$conf->global->LDAP_FIELD_COMPANY] = $soc->name;
|
||||||
|
if ($soc->client == 1) $info["businessCategory"] = "Customers";
|
||||||
|
if ($soc->client == 2) $info["businessCategory"] = "Prospects";
|
||||||
|
if ($soc->fournisseur == 1) $info["businessCategory"] = "Suppliers";
|
||||||
|
}
|
||||||
|
|
||||||
|
// When password is modified
|
||||||
|
if (! empty($this->pass))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->LDAP_FIELD_PASSWORD)) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass; // this->pass = mot de passe non crypte
|
||||||
|
if (! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass, 4); // Create OpenLDAP MD5 password (TODO add type of encryption)
|
||||||
|
}
|
||||||
|
// Set LDAP password if possible
|
||||||
|
else if ($conf->global->LDAP_SERVER_PROTOCOLVERSION !== '3') // If ldap key is modified and LDAPv3 we use ldap_rename function for avoid lose encrypt password
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->DATABASE_PWD_ENCRYPTED))
|
||||||
|
{
|
||||||
|
// Just for the default MD5 !
|
||||||
|
if (empty($conf->global->MAIN_SECURITY_HASH_ALGO))
|
||||||
|
{
|
||||||
|
if ($this->pass_indatabase_crypted && ! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED)) {
|
||||||
|
$info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase_crypted, 5); // Create OpenLDAP MD5 password from Dolibarr MD5 password
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Use $this->pass_indatabase value if exists
|
||||||
|
else if (! empty($this->pass_indatabase))
|
||||||
|
{
|
||||||
|
if (! empty($conf->global->LDAP_FIELD_PASSWORD)) $info[$conf->global->LDAP_FIELD_PASSWORD] = $this->pass_indatabase; // $this->pass_indatabase = mot de passe non crypte
|
||||||
|
if (! empty($conf->global->LDAP_FIELD_PASSWORD_CRYPTED)) $info[$conf->global->LDAP_FIELD_PASSWORD_CRYPTED] = dol_hash($this->pass_indatabase, 4); // md5 for OpenLdap TODO add type of encryption
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($conf->global->LDAP_SERVER_TYPE == 'egroupware')
|
if ($conf->global->LDAP_SERVER_TYPE == 'egroupware')
|
||||||
{
|
{
|
||||||
|
|||||||
@ -29,7 +29,6 @@ require_once DOL_DOCUMENT_ROOT.'/user/class/usergroup.class.php';
|
|||||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
|
||||||
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
|
||||||
if(! empty($conf->multicompany->enabled)) dol_include_once('/multicompany/class/actions_multicompany.class.php');
|
|
||||||
|
|
||||||
// Defini si peux lire/modifier utilisateurs et permisssions
|
// Defini si peux lire/modifier utilisateurs et permisssions
|
||||||
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
$canreadperms=($user->admin || $user->rights->user->user->lire);
|
||||||
|
|||||||
@ -26,9 +26,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
require '../main.inc.php';
|
require '../main.inc.php';
|
||||||
if (! empty($conf->multicompany->enabled))
|
|
||||||
dol_include_once('/multicompany/class/actions_multicompany.class.php', 'ActionsMulticompany');
|
|
||||||
|
|
||||||
|
|
||||||
if (! $user->rights->user->user->lire && ! $user->admin)
|
if (! $user->rights->user->user->lire && ! $user->admin)
|
||||||
accessforbidden();
|
accessforbidden();
|
||||||
|
|||||||
@ -57,28 +57,27 @@ $parameters=array('id'=>$socid);
|
|||||||
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
$reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
|
||||||
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook))
|
||||||
if ($_GET["action"] == 'dolibarr2ldap') {
|
{
|
||||||
$db->begin();
|
if ($_GET["action"] == 'dolibarr2ldap')
|
||||||
|
{
|
||||||
$ldap = new Ldap();
|
$ldap = new Ldap();
|
||||||
$result = $ldap->connect_bind();
|
$result = $ldap->connect_bind();
|
||||||
|
|
||||||
|
if ($result > 0)
|
||||||
|
{
|
||||||
$info = $object->_load_ldap_info();
|
$info = $object->_load_ldap_info();
|
||||||
$dn = $object->_load_ldap_dn($info);
|
$dn = $object->_load_ldap_dn($info);
|
||||||
$olddn = $dn; // We can say that old dn = dn as we force synchro
|
$olddn = $dn; // We can say that old dn = dn as we force synchro
|
||||||
|
|
||||||
$result = $ldap->update($dn, $info, $user, $olddn);
|
$result = $ldap->update($dn, $info, $user, $olddn);
|
||||||
|
|
||||||
if ($result >= 0)
|
|
||||||
{
|
|
||||||
setEventMessages($langs->trans("UserSynchronized"), null, 'mesgs');
|
|
||||||
$db->commit();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
if ($result >= 0) {
|
||||||
|
setEventMessages($langs->trans("UserSynchronized"), null, 'mesgs');
|
||||||
|
}
|
||||||
|
else {
|
||||||
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
setEventMessages($ldap->error, $ldap->errors, 'errors');
|
||||||
$db->rollback();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user