Merge remote-tracking branch 'Upstream/develop' into develop-32

Conflicts:
	htdocs/expensereport/card.php
This commit is contained in:
aspangaro 2015-06-17 07:21:43 +02:00
commit 50aa36502c
56 changed files with 828 additions and 381 deletions

View File

@ -482,6 +482,7 @@ Fix: [ bug #2976 ] "Report" tab is the current tab but it is not marked as selec
Fix: [ bug #2861 ] Undefined variable $res when migrating
Fix: [ bug #2837 ] Product list table column header does not match column body
Fix: [ bug #2835 ] Customer prices of a product shows incorrect history order
Fix: [ bug #2814 ] JPEG photos are not displayed in Product photos page
***** ChangeLog for 3.5.6 compared to 3.5.5 *****
Fix: Avoid missing class error for fetch_thirdparty method #1973

View File

@ -1,5 +1,5 @@
<?php
/* Copyright (C) 2007-2010 Laurent Destailleur <eldy@users.sourceforge.net>
/* Copyright (C) 2007-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) ---Put here your own copyright and developer email---
*
* This program is free software; you can redistribute it and/or modify
@ -72,6 +72,9 @@ if (($id > 0 || ! empty($ref)) && $action != 'add')
if ($result < 0) dol_print_error($db);
}
// Initialize technical object to manage hooks of modules. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('skeleton'));
/*******************************************************************
@ -80,108 +83,114 @@ if (($id > 0 || ! empty($ref)) && $action != 'add')
* Put here all code to do according to value of "action" parameter
********************************************************************/
// Action to add record
if ($action == 'add')
$parameters=array();
$reshook=$hookmanager->executeHooks('doActions',$parameters); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
if (empty($reshook))
{
if (GETPOST('cancel'))
// Action to add record
if ($action == 'add')
{
$urltogo=$backtopage?$backtopage:dol_buildpath('/buildingmanagement/list.php',1);
header("Location: ".$urltogo);
exit;
}
$error=0;
/* object_prop_getpost_prop */
$object->prop1=GETPOST("field1");
$object->prop2=GETPOST("field2");
if (empty($object->ref))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors');
}
if (! $error)
{
$result=$object->create($user);
if ($result > 0)
if (GETPOST('cancel'))
{
// Creation OK
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
$urltogo=$backtopage?$backtopage:dol_buildpath('/buildingmanagement/list.php',1);
header("Location: ".$urltogo);
exit;
}
$error=0;
/* object_prop_getpost_prop */
$object->prop1=GETPOST("field1");
$object->prop2=GETPOST("field2");
if (empty($object->ref))
{
// Creation KO
if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessages($object->error, null, 'errors');
$action='create';
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),'errors');
}
}
else
{
$action='create';
}
}
// Cancel
if ($action == 'update' && GETPOST('cancel')) $action='view';
// Action to update record
if ($action == 'update' && ! GETPOST('cancel'))
{
$error=0;
$object->prop1=GETPOST("field1");
$object->prop2=GETPOST("field2");
if (empty($object->ref))
{
$error++;
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors');
}
if (! $error)
{
$result=$object->update($user);
if ($result > 0)
if (! $error)
{
$action='view';
$result=$object->create($user);
if ($result > 0)
{
// Creation OK
$urltogo=$backtopage?$backtopage:dol_buildpath('/mymodule/list.php',1);
header("Location: ".$urltogo);
exit;
}
{
// Creation KO
if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessages($object->error, null, 'errors');
$action='create';
}
}
else
{
$action='create';
}
}
// Cancel
if ($action == 'update' && GETPOST('cancel')) $action='view';
// Action to update record
if ($action == 'update' && ! GETPOST('cancel'))
{
$error=0;
$object->prop1=GETPOST("field1");
$object->prop2=GETPOST("field2");
if (empty($object->ref))
{
$error++;
setEventMessages($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Ref")),null,'errors');
}
if (! $error)
{
$result=$object->update($user);
if ($result > 0)
{
$action='view';
}
else
{
// Creation KO
if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessages($object->error, null, 'errors');
$action='edit';
}
}
else
{
// Creation KO
if (! empty($object->errors)) setEventMessages(null, $object->errors, 'errors');
else setEventMessages($object->error, null, 'errors');
$action='edit';
}
}
else
// Action to delete
if ($action == 'confirm_delete')
{
$action='edit';
$result=$object->delete($user);
if ($result > 0)
{
// Delete OK
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
header("Location: ".dol_buildpath('/buildingmanagement/list.php',1));
exit;
}
else
{
if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors');
else setEventMessages($object->error,null,'errors');
}
}
}
// Action to delete
if ($action == 'confirm_delete')
{
$result=$object->delete($user);
if ($result > 0)
{
// Delete OK
setEventMessages($langs->trans("RecordDeleted"), null, 'mesgs');
header("Location: ".dol_buildpath('/buildingmanagement/list.php',1));
exit;
}
else
{
if (! empty($object->errors)) setEventMessages(null,$object->errors,'errors');
else setEventMessages($object->error,null,'errors');
}
}
@ -225,11 +234,39 @@ if ($action == 'list' || empty($id))
$sql.= " WHERE field3 = 'xxx'";
$sql.= " ORDER BY field1 ASC";
print '<table class="noborder">'."\n";
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
if (! empty($moreforfilter))
{
print '<div class="liste_titre">';
print $moreforfilter;
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print '</div>';
}
print '<table class="noborder">'."\n";
// Fields title
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans('field1'),$_SERVER['PHP_SELF'],'t.field1','',$param,'',$sortfield,$sortorder);
print_liste_field_titre($langs->trans('field2'),$_SERVER['PHP_SELF'],'t.field2','',$param,'',$sortfield,$sortorder);
print '</tr>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print '</tr>'."\n";
// Fields title search
print '<tr class="liste_titre">';
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_field1" value="'.$search_field1.'" size="10">';
print '</td>';
print '<td class="liste_titre">';
print '<input type="text" class="flat" name="search_field2" value="'.$search_field2.'" size="10">';
print '</td>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print '</tr>'."\n";
dol_syslog($script_file, LOG_DEBUG);
$resql=$db->query($sql);
@ -243,21 +280,32 @@ if ($action == 'list' || empty($id))
if ($obj)
{
// You can use here results
print '<tr><td>';
print '<tr>';
print '<td>';
print $obj->field1;
print '</td><td>';
print $obj->field2;
print '</td></tr>';
print '</td>';
$parameters=array('obj' => $obj);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print '</tr>';
}
$i++;
}
}
else
{
{
$error++;
dol_print_error($db);
}
print '</table>'."\n";
$db->free($resql);
$parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print "</table>\n";
print "</form>\n";
}
@ -267,12 +315,12 @@ if ($action == 'create')
{
print_fiche_titre($langs->trans("NewResidence"));
dol_fiche_head();
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
dol_fiche_head();
print '<table class="border centpercent">'."\n";
print '<tr><td class="fieldrequired">'.$langs->trans("Label").'</td><td>';
print '<input class="flat" type="text" size="36" name="label" value="'.$label.'">';
@ -280,13 +328,11 @@ if ($action == 'create')
print '</table>'."\n";
print '<br>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"> &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'"></div>';
print '</form>';
dol_fiche_end();
}
@ -294,21 +340,19 @@ if ($action == 'create')
// Part to edit record
if (($id || $ref) && $action == 'edit')
{
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
dol_fiche_head();
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
print '<input type="hidden" name="id" value="'.$object->id.'">';
print '<br>';
dol_fiche_end();
print '<div class="center"><input type="submit" class="button" name="add" value="'.$langs->trans("Create").'"></div>';
print '</form>';
dol_fiche_end();
}

View File

@ -3,7 +3,7 @@
* Copyright (C) 2005-2010 Laurent Destailleur <eldy@users.sourceforge.org>
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Regis Houssin <jfefe@aternatik.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
*
* 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
@ -33,27 +33,22 @@ $langs->load("admin");
if (! $user->admin)
accessforbidden();
$actionsave=GETPOST("save");
$action=GETPOST("action");
// Sauvegardes parametres
if ($actionsave)
//Activate ProfId
if ($action == 'setproductionmode')
{
$i=0;
$status = GETPOST('status','alpha');
$db->begin();
$i+=dolibarr_set_const($db,'API_KEY',trim(GETPOST("API_KEY")),'chaine',0,'',$conf->entity);
if ($i >= 1)
{
$db->commit();
setEventMessage($langs->trans("SetupSaved"));
}
else
{
$db->rollback();
setEventMessage($langs->trans("Error"), 'errors');
}
if (dolibarr_set_const($db, 'API_PRODUCTION_MODE', $status, 'chaine', 0, '', $conf->entity) > 0)
{
header("Location: ".$_SERVER["PHP_SELF"]);
exit;
}
else
{
dol_print_error($db);
}
}
@ -69,7 +64,7 @@ print_fiche_titre($langs->trans("ApiSetup"),$linkback,'title_setup');
print $langs->trans("ApiDesc")."<br>\n";
print "<br>\n";
print '<form name="apisetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
//print '<form name="apisetupform" action="'.$_SERVER["PHP_SELF"].'" method="post">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<table class="noborder" width="100%">';
@ -80,22 +75,24 @@ print "<td>&nbsp;</td>";
print "</tr>";
print '<tr class="impair">';
print '<td class="fieldrequired">'.$langs->trans("KeyForApiAccess").'</td>';
print '<td><input type="text" class="flat" id="API_KEY" name="API_KEY" value="'. (GETPOST('API_KEY')?GETPOST('API_KEY'):(! empty($conf->global->API_KEY)?$conf->global->API_KEY:'')) . '" size="40">';
if (! empty($conf->use_javascript_ajax))
print '&nbsp;'.img_picto($langs->trans('Generate'), 'refresh', 'id="generate_token" class="linkobject"');
print '</td>';
print '<td>'.$langs->trans("ApiProductionMode").'</td>';
$production_mode=(empty($conf->global->API_PRODUCTION_MODE)?false:true);
if ($production_mode)
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setproductionmode&value='.($i+1).'&status=0">';
print img_picto($langs->trans("Activated"),'switch_on');
print '</a></td>';
}
else
{
print '<td align="center"><a href="'.$_SERVER['PHP_SELF'].'?action=setproductionmode&value='.($i+1).'&status=1">';
print img_picto($langs->trans("Disabled"),'switch_off');
print '</a></td>';
}
print '<td>&nbsp;</td>';
print '</tr>';
print '</table>';
print '<br><div class="center">';
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Save").'">';
print '</div>';
print '</form>';
print '<br><br>';
// API endpoint
@ -111,27 +108,9 @@ $url=DOL_MAIN_URL_ROOT.'/public/api/explorer/index.html';
print img_picto('','object_globe.png').' <a href="'.$url.'" target="_blank">'.$url."</a><br>\n";
print '<br>';
print '<br>';
print $langs->trans("OnlyActiveElementsAreExposed", DOL_URL_ROOT.'/admin/modules.php');
if (! empty($conf->use_javascript_ajax))
{
print "\n".'<script type="text/javascript">';
print '$(document).ready(function () {
$("#generate_token").click(function() {
$.get( "'.DOL_URL_ROOT.'/core/ajax/security.php", {
action: \'getrandompassword\',
generic: true
},
function(token) {
$("#API_KEY").val(token);
});
});
});';
print '</script>';
}
llxFooter();

View File

@ -43,8 +43,10 @@ class DolibarrApi
* @param DoliDb $db Database handler
*/
function __construct($db) {
global $conf;
$this->db = $db;
$this->r = new Restler();
$production_mode = ( empty($conf->global->API_PRODUCTION_MODE) ? false : true );
$this->r = new Restler($production_mode);
}
/**

View File

@ -52,7 +52,7 @@ class DolibarrApiAccess implements iAuthenticate
* @return bool
* @throws RestException
*/
public function _isAllowed()
public function __isAllowed()
{
global $db;
@ -114,7 +114,7 @@ class DolibarrApiAccess implements iAuthenticate
* @example Digest
* @example OAuth
*/
public function _getWWWAuthenticateString()
public function __getWWWAuthenticateString()
{
return '';
}

View File

@ -7,6 +7,7 @@
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -251,6 +252,11 @@ if ($socid)
print $form->showrefnav($soc,'socid','',($user->societe_id?0:1),'rowid','nom','','&type='.$type);
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $soc->name_alias;
print "</td></tr>";
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$soc->prefix_comm.'</td></tr>';

View File

@ -37,6 +37,7 @@ require_once DOL_DOCUMENT_ROOT.'/comm/action/class/cactioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.form.class.php';
if (! empty($conf->projet->enabled))
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
@ -57,6 +58,7 @@ $backtopage=GETPOST('backtopage','alpha');
$contactid=GETPOST('contactid','int');
$origin=GETPOST('origin','alpha');
$originid=GETPOST('originid','int');
$confirm = GETPOST('confirm', 'alpha');
$fulldayevent=GETPOST('fullday');
$datep=dol_mktime($fulldayevent?'00':GETPOST("aphour"), $fulldayevent?'00':GETPOST("apmin"), 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear"));
@ -78,6 +80,10 @@ $contact = new Contact($db);
$extrafields = new ExtraFields($db);
$formfile = new FormFile($db);
$form = new Form($db);
$formfile = new FormFile($db);
$formactions = new FormActions($db);
// fetch optionals attributes and labels
$extralabels=$extrafields->fetch_name_optionals_label($object->table_element);
@ -129,6 +135,29 @@ if (GETPOST('addassignedtouser') || GETPOST('updateassignedtouser'))
if ($action == 'update') $action = 'edit';
}
// Action clone object
if ($action == 'confirm_clone' && $confirm == 'yes')
{
if (1 == 0 && ! GETPOST('clone_content') && ! GETPOST('clone_receivers'))
{
setEventMessage($langs->trans("NoCloneOptionsSpecified"), 'errors');
}
else
{
if ($id > 0) {
$object->fetch($id);
$result = $object->createFromClone(GETPOST('fk_userowner'), GETPOST('socid'));
if ($result > 0) {
header("Location: " . $_SERVER['PHP_SELF'] . '?id=' . $result);
exit();
} else {
setEventMessage($object->error, 'errors');
$action = '';
}
}
}
}
// Add event
if ($action == 'add')
{
@ -542,10 +571,6 @@ if ($action == 'mupdate')
$help_url='EN:Module_Agenda_En|FR:Module_Agenda|ES:M&omodulodulo_Agenda';
llxHeader('',$langs->trans("Agenda"),$help_url);
$form = new Form($db);
$formfile = new FormFile($db);
$formactions = new FormActions($db);
if ($action == 'create')
{
$contact = new Contact($db);
@ -1035,6 +1060,15 @@ if ($id > 0)
{
dol_fiche_head($head, 'card', $langs->trans("Action"),0,'action');
// Clone event
if($action == 'clone')
{
$formconfirm = $form->formconfirm($_SERVER["PHP_SELF"] . '?id=' . GETPOST('id'), $langs->trans('CloneAction'), $langs->trans('ConfirmCloneAction', $object->label), 'confirm_clone', $formquestion, 'yes', 1);
print $formconfirm;
}
// Affichage fiche action en mode visu
print '<table class="border" width="100%">';
@ -1241,7 +1275,17 @@ if ($id > 0)
{
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("Modify").'</a></div>';
}
if ($user->rights->agenda->allactions->create ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))
{
print '<div class="inline-block divButAction"><a class="butAction" href="card.php?action=clone&object='.$object->element.'&id='.$object->id.'">'.$langs->trans("ToClone").'</a></div>';
}
else
{
print '<div class="inline-block divButAction"><a class="butActionRefused" href="#" title="'.$langs->trans("NotAllowed").'">'.$langs->trans("ToClone").'</a></div>';
}
if ($user->rights->agenda->allactions->delete ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->delete))
{

View File

@ -391,6 +391,67 @@ class ActionComm extends CommonObject
}
/**
* Load an object from its id and create a new one in database
*
* @param int $socid Id of thirdparty
* @return int New id of clone
*/
function createFromClone()
{
global $db, $user,$langs,$conf,$hookmanager;
$this->context['createfromclone']='createfromclone';
$error=0;
$now=dol_now();
$this->db->begin();
// Load source object
$objFrom = dol_clone($this);
$this->fetch_optionals();
$this->fetch_userassigned();
$this->id=0;
// Create clone
$result=$this->add($user);
if ($result < 0) $error++;
if (! $error)
{
// Hook of thirdparty module
if (is_object($hookmanager))
{
$parameters=array('objFrom'=>$objFrom);
$action='';
$reshook=$hookmanager->executeHooks('createFrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
}
// Call trigger
$result=$this->call_trigger('ACTION_CLONE',$user);
if ($result < 0) { $error++; }
// End call triggers
}
unset($this->context['createfromclone']);
// End
if (! $error)
{
$this->db->commit();
return $this->id;
}
else
{
$this->db->rollback();
return -1;
}
}
/**
* Load object from database
*

View File

@ -8,6 +8,7 @@
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Alexandre Spangaro <alexandre.spangaro@gmail.com>
* Copyright (C) 2015 Frederic France <frederic.france@free.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -226,6 +227,11 @@ if ($id > 0)
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
// Prospect/Customer
print '<tr><td width="30%">'.$langs->trans('ProspectCustomer').'</td><td width="70%" colspan="3">';
print $object->getLibCustProspStatut();

View File

@ -5,6 +5,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* This program is freei software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -91,6 +92,7 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
if ($search_status=='') $search_status=1; // always display activ customer first
/*
* view
*/
@ -102,7 +104,7 @@ $thirdpartystatic=new Societe($db);
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$langs->trans("ThirdParty"),$help_url);
$sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
$sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
$sql.= " s.datec, s.canvas";
if ((!$user->rights->societe->client->voir && !$socid) || $search_sale > 0) $sql .= ", sc.fk_soc, sc.fk_user"; // We need these fields in order to filter by sale (including the case where the user can only see his prospects)
$sql.= " FROM ".MAIN_DB_PREFIX."societe as s";
@ -120,7 +122,13 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_company) {
$sql .= natural_search('s.nom', $search_company);
$sql .= natural_search(
array(
's.nom',
's.name_alias'
),
$search_company
);
}
if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
if ($search_town) {
@ -195,10 +203,9 @@ if ($result)
print_liste_field_titre($langs->trans("AccountancyCode"),$_SERVER["PHP_SELF"],"s.code_compta","",$param,'align="left"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("DateCreation"),$_SERVER["PHP_SELF"],"datec","",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"s.status","",$param,'align="center"',$sortfield,$sortorder);
print '<td class="liste_titre">&nbsp;</td>';
print_liste_field_titre('');
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
print '<tr class="liste_titre">';
@ -238,7 +245,8 @@ if ($result)
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
print '</tr>'."\n";
$var=True;
@ -256,6 +264,7 @@ if ($result)
$thirdpartystatic->code_client=$obj->code_client;
$thirdpartystatic->canvas=$obj->canvas;
$thirdpartystatic->status=$obj->status;
$thirdpartystatic->name_alias=$obj->name_alias;
print $thirdpartystatic->getNomUrl(1);
print '</td>';
print '<td>'.$obj->zip.'</td>';
@ -273,13 +282,13 @@ if ($result)
print "</tr>\n";
$i++;
}
//print_barre_liste($langs->trans("ListOfCustomers"), $page, $_SERVER["PHP_SELF"],'',$sortfield,$sortorder,'',$num);
print "</table>\n";
print "</form>\n";
$db->free($result);
$parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print "</table>\n";
print "</form>\n";
}
else
{

View File

@ -7,6 +7,7 @@
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -208,7 +209,7 @@ $prospectstatic=new Client($db);
$prospectstatic->client=2;
$prospectstatic->loadCacheOfProspStatus();
$sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,";
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.datec, s.status as status, s.code_client, s.client,";
$sql.= " s.prefix_comm, s.fk_prospectlevel, s.fk_stcomm as stcomm_id,";
$sql.= " st.libelle as stcomm_label,";
$sql.= " d.nom as departement";
@ -228,7 +229,15 @@ if ($catid > 0) $sql.= " AND cs.fk_categorie = ".$catid;
if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_nom) $sql .= natural_search('s.nom', $search_nom);
if ($search_nom) {
$sql .= natural_search(
array(
's.nom',
's.name_alias'
),
$search_nom
);
}
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape(strtolower($search_zipcode))."%'";
if ($search_town) $sql .= natural_search('s.town', $search_town);
if ($search_state) $sql .= natural_search('d.nom', $search_state);
@ -427,6 +436,7 @@ if ($resql)
$prospectstatic->code_client=$obj->code_client;
$prospectstatic->client=$obj->client;
$prospectstatic->fk_prospectlevel=$obj->fk_prospectlevel;
$prospectstatic->name_alias=$obj->name_alias;
print $prospectstatic->getNomUrl(1,'prospect');
print '</td>';
print "<td>".$obj->zip."</td>";

View File

@ -3,6 +3,7 @@
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -148,6 +149,7 @@ abstract class CommonDocGenerator
$array_thirdparty = array(
'company_name'=>$object->name,
'company_name_alias' => $object->name_alias,
'company_email'=>$object->email,
'company_phone'=>$object->phone,
'company_fax'=>$object->fax,

View File

@ -1,19 +1,20 @@
<?php
/* Copyright (c) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
* 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
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/**
* \file htdocs/core/class/html.formprojet.class.php
@ -52,11 +53,59 @@ class FormProjets
* @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled
* @param int $mode 0 for HTML mode and 1 for JSON mode
* @param string $filterkey Key to filter
* @return int Nber of project if OK, <0 if KO
*/
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0)
function select_projects($socid=-1, $selected='', $htmlname='projectid', $maxlength=16, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '')
{
global $langs,$conf;
if (! empty($conf->use_javascript_ajax) && ! empty($conf->global->PROJECT_USE_SEARCH_TO_SELECT))
{
$placeholder='';
if ($selected && empty($selected_input_value))
{
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$project = new Project($this->db);
$project->fetch($selected);
$selected_input_value=$project->ref;
}
$urloption='socid='.$socid.'&htmlname='.$htmlname;
print ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/projet/ajax/projects.php', $urloption, $conf->global->PROJECT_USE_SEARCH_TO_SELECT, 0, array(
// 'update' => array(
// 'projectid' => 'id'
// )
));
print '<input type="text" size="20" name="search_'.$htmlname.'" id="search_'.$htmlname.'" value="'.$selected_input_value.'"'.$placeholder.' />';
}
else
{
print $this->select_projects_list($socid, $selected, $htmlname, $maxlength, $option_only, $show_empty, $discard_closed, $forcefocus, $disabled, 0, $filterkey);
}
}
/**
* Returns an array with projects qualified for a third party
*
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id project preselected
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $option_only Return only html options lines without the select tag
* @param int $show_empty Add an empty line
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely,2=Disable)
* @param int $forcefocus Force focus on field (works with javascript only)
* @param int $disabled Disabled
* @param int $mode 0 for HTML mode and 1 for JSON mode
* @param string $filterkey Key to filter
* @return int Nber of project if OK, <0 if KO
*/
function select_projects_list($socid=-1, $selected='', $htmlname='projectid', $maxlength=24, $option_only=0, $show_empty=1, $discard_closed=0, $forcefocus=0, $disabled=0, $mode = 0, $filterkey = '')
{
global $user,$conf,$langs;
@ -81,6 +130,10 @@ class FormProjets
if ($projectsListId !== false) $sql.= " AND p.rowid IN (".$projectsListId.")";
if ($socid == 0) $sql.= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
if ($socid > 0) $sql.= " AND (p.fk_soc=".$socid." OR p.fk_soc IS NULL)";
if (!empty($filterkey)) {
$sql .= ' AND p.title LIKE "%'.$this->db->escape($filterkey).'%"';
$sql .= ' OR p.ref LIKE "%'.$this->db->escape($filterkey).'%"';
}
$sql.= " ORDER BY p.ref ASC";
dol_syslog(__METHOD__, LOG_DEBUG);
@ -126,7 +179,7 @@ class FormProjets
continue;
}
$labeltoshow=dol_trunc($obj->ref,18);
$labeltoshow=dol_trunc($obj->ref,18).' - '.$obj->title;
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
$labeltoshow.=' '.dol_trunc($obj->title,$maxlength);
@ -171,19 +224,30 @@ class FormProjets
$resultat.='</option>';
}
$out.= $resultat;
$outarray[] = array(
'key' => (int) $obj->rowid,
'value' => $obj->ref,
'ref' => $obj->ref,
'label' => $labeltoshow,
'disabled' => (bool) $disabled
);
}
}
$i++;
}
}
if (empty($option_only)) {
$out.= '</select>';
}
print $out;
$this->db->free($resql);
return $num;
if (!$mode) {
if (empty($option_only)) {
$out.= '</select>';
}
print $out;
} else {
return $outarray;
}
}
else
{
@ -290,7 +354,7 @@ class FormProjets
}
else if ($obj->fk_statut == 2)
{
if ($discard_close == 2) $disabled=1;
if ($discard_closed == 2) $disabled=1;
$labeltoshow.=' - '.$langs->trans("Closed");
}
else if ($socid > 0 && (! empty($obj->fk_soc) && $obj->fk_soc != $socid))
@ -299,7 +363,7 @@ class FormProjets
$labeltoshow.=' - '.$langs->trans("LinkedToAnotherCompany");
}
// Label for task
$labeltoshow.=' - '.$obj->tref.' '.dol_trunc($obj->tlabel,$maxlenght);
$labeltoshow.=' - '.$obj->tref.' '.dol_trunc($obj->tlabel,$maxlength);
if (!empty($selected) && $selected == $obj->rowid)
{

View File

@ -9,6 +9,7 @@
* Copyright (C) 2012-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2014 Cedric GROSS <c.gross@kreiz-it.fr>
* Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -289,6 +290,33 @@ function pdf_getHeightForLogo($logo, $url = false)
return $height;
}
/**
* Returns the name of the thirdparty
*
* @param Societe|Contact $thirdparty Contact or thirdparty
* @param Translate $outputlangs Output language
* @return string
*/
function pdfBuildThirdpartyName($thirdparty, Translate $outputlangs)
{
//Recipient name
$socname = '';
// On peut utiliser le nom de la societe du contact
if ($thirdparty instanceof Societe) {
if (!empty($thirdparty->name_alias)) {
$socname = $thirdparty->name_alias."\n";
}
$socname .= $thirdparty->name;
} elseif ($thirdparty instanceof Contact) {
$socname = $thirdparty->socname;
} else {
throw new InvalidArgumentException();
}
return $outputlangs->convToOutputCharset($socname);
}
/**
* Return a string with full address formated

View File

@ -5,6 +5,7 @@
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -1293,19 +1294,16 @@ class pdf_einstein extends ModelePDFCommandes
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
// Show recipient

View File

@ -4,6 +4,7 @@
* Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
* Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -1185,19 +1186,16 @@ class pdf_proforma extends ModelePDFCommandes
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
// Show recipient

View File

@ -5,6 +5,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011 Fabrice CHERRIER
* Copyright (C) 2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -598,17 +599,16 @@ class pdf_strato extends ModelePDFContract
$this->recipient = $object->client;
// Recipient name
if (! empty($usecontact)) {
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$this->recipient->name = $outputlangs->convToOutputCharset($socname);
}
else {
$this->recipient->name = $outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$this->recipient->name = pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
// Show recipient

View File

@ -2,7 +2,8 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -622,19 +623,16 @@ class pdf_merou extends ModelePdfExpedition
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,((!empty($object->contact))?$object->contact:null),$usecontact,'targetwithdetails');
$blDestX=$blExpX+55;

View File

@ -2,7 +2,7 @@
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2014-2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -662,19 +662,16 @@ class pdf_rouget extends ModelePdfExpedition
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,(!empty($object->contact)?$object->contact:null),$usecontact,'targetwithdetails');
// Show recipient

View File

@ -6,6 +6,7 @@
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2012-2014 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -1579,19 +1580,16 @@ class pdf_crabe extends ModelePDFFactures
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
// Show recipient

View File

@ -5,6 +5,7 @@
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
* Copyright (C) 2011 Fabrice CHERRIER
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -609,19 +610,16 @@ class pdf_soleil extends ModelePDFFicheinter
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs, $this->emetteur, $object->client, (isset($object->contact)?$object->contact:''), $usecontact, 'target');
// Show recipient

View File

@ -4,6 +4,7 @@
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2008 Chiptronik
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* 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
@ -843,19 +844,16 @@ class pdf_typhon extends ModelePDFDeliveryOrder
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
// Show recipient

View File

@ -5,6 +5,7 @@
* Copyright (C) 2010-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2012 Christophe Battarel <christophe.battarel@altairis.fr>
* Copyright (C) 2012 Cedric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -1485,19 +1486,16 @@ class pdf_azur extends ModelePDFPropales
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
// Show recipient

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2010-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -1100,19 +1101,16 @@ class pdf_canelle extends ModelePDFSuppliersInvoices
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $mysoc->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($mysoc->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $mysoc;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$mysoc,((!empty($object->contact))?$object->contact:null),$usecontact,'target');
// Show recipient

View File

@ -3,6 +3,7 @@
* Copyright (C) 2005-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2007 Franky Van Liedekerke <franky.van.liedekerke@telenet.be>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -1152,19 +1153,16 @@ class pdf_muscadet extends ModelePDFSuppliersOrders
$result=$object->fetch_contact($arrayidcontact[0]);
}
// Recipient name
if (! empty($usecontact))
{
// On peut utiliser le nom de la societe du contact
if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
else $socname = $object->client->name;
$carac_client_name=$outputlangs->convToOutputCharset($socname);
}
else
{
$carac_client_name=$outputlangs->convToOutputCharset($object->client->name);
//Recipient name
// On peut utiliser le nom de la societe du contact
if ($usecontact && !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) {
$thirdparty = $object->contact;
} else {
$thirdparty = $object->client;
}
$carac_client_name= pdfBuildThirdpartyName($thirdparty, $outputlangs);
$carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->client,($usecontact?$object->contact:''),$usecontact,'target');
// Show recipient

View File

@ -41,6 +41,7 @@ require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php';
$langs->load("trips");
$langs->load("bills");
$langs->load("mails");
$action=GETPOST('action');
$cancel=GETPOST('cancel');

View File

@ -109,8 +109,8 @@ $dolibarr_main_document_root_alt=(empty($dolibarr_main_document_root_alt)?'':tri
if (empty($dolibarr_main_db_port)) $dolibarr_main_db_port=0; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
if (empty($dolibarr_main_db_type)) $dolibarr_main_db_type='mysql'; // Pour compatibilite avec anciennes configs, si non defini, on prend 'mysql'
if (empty($dolibarr_main_db_prefix)) $dolibarr_main_db_prefix='llx_';
if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set=($dolibarr_main_db_type=='mysql'?'latin1':''); // Old installation
if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation=($dolibarr_main_db_type=='mysql'?'latin1_swedish_ci':''); // Old installation
if (empty($dolibarr_main_db_character_set)) $dolibarr_main_db_character_set=($dolibarr_main_db_type=='mysql'?'utf8':''); // Old installation
if (empty($dolibarr_main_db_collation)) $dolibarr_main_db_collation=($dolibarr_main_db_type=='mysql'?'utf8_general_ci':''); // Old installation
if (empty($dolibarr_main_db_encryption)) $dolibarr_main_db_encryption=0;
if (empty($dolibarr_main_db_cryptkey)) $dolibarr_main_db_cryptkey='';
if (empty($dolibarr_main_limit_users)) $dolibarr_main_limit_users=0;

View File

@ -138,6 +138,11 @@ if ($object->id > 0)
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom','','');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2010-2011 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2014 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2015 Charlie Benke <charlie@patas-monkey.com>
*
* 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
@ -35,6 +36,7 @@ print_titre($langs->trans("RelatedSupplierInvoices"));
<table class="noborder allwidth">
<tr class="liste_titre">
<td><?php echo $langs->trans("Ref"); ?></td>
<td align="left"><?php echo $langs->trans("RefSupplier"); ?></td>
<td align="center"><?php echo $langs->trans("Date"); ?></td>
<td align="right"><?php echo $langs->trans("AmountHTShort"); ?></td>
<td align="right"><?php echo $langs->trans("Status"); ?></td>
@ -46,8 +48,9 @@ foreach($linkedObjectBlock as $object)
{
$var=!$var;
?>
<tr <?php echo $bc[$var]; ?> ><td>
<a href="<?php echo DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$object->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$object->ref; ?></a></td>
<tr <?php echo $bc[$var]; ?> >
<td></td><a href="<?php echo DOL_URL_ROOT.'/fourn/facture/card.php?facid='.$object->id ?>"><?php echo img_object($langs->trans("ShowBill"),"bill").' '.$object->ref; ?></a></td>
<td align="left"><?php echo $object->ref_supplier; ?></td>
<td align="center"><?php echo dol_print_date($object->date,'day'); ?></td>
<td align="right"><?php
if ($user->rights->fournisseur->facture->lire) {

View File

@ -98,7 +98,7 @@ $thirdpartystatic=new Societe($db);
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$langs->trans("ThirdParty"),$help_url);
$sql = "SELECT s.rowid as socid, s.nom as name, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias, s.zip, s.town, s.datec, st.libelle as stcomm, s.prefix_comm, s.status as status, ";
$sql.= "code_fournisseur, code_compta_fournisseur";
if (!$user->rights->societe->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user ";
// Add fields for extrafields
@ -122,7 +122,13 @@ if ($socname) {
$sortorder = "ASC";
}
if ($search_name) {
$sql .= natural_search('s.nom', $search_name);
$sql .= natural_search(
array(
's.nom',
's.name_alias'
),
$search_name
);
}
if ($search_zipcode) $sql .= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
if ($search_town) {
@ -237,6 +243,7 @@ if ($resql)
$thirdpartystatic->id=$obj->socid;
$thirdpartystatic->name=$obj->name;
$thirdpartystatic->status=$obj->status;
$thirdpartystatic->name_alias=$obj->name_alias;
print "<tr ".$bc[$var].">";
print '<td>';

View File

@ -304,7 +304,8 @@ create table llx_payment_expensereport
ALTER TABLE llx_projet ADD COLUMN budget_amount double(24,8);
-- Alias names (commercial, trademark or alias names)
ALTER TABLE llx_societe ADD COLUMN name_alias varchar(128) NULL;
create table llx_commande_fournisseurdet_extrafields
(

View File

@ -4,6 +4,7 @@
-- Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
-- Copyright (C) 2010 Juanjo Menent <dolibarr@2byte.es>
-- Copyright (C) 2014 Teddy Andreotti <125155@supinfo.com>
-- Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
--
-- 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
@ -24,6 +25,7 @@ create table llx_societe
(
rowid integer AUTO_INCREMENT PRIMARY KEY,
nom varchar(128), -- company reference name (should be same length than adherent.societe)
name_alias varchar(128) NULL,
entity integer DEFAULT 1 NOT NULL, -- multi company id
ref_ext varchar(128), -- reference into an external system (not used by dolibarr)

View File

@ -1564,6 +1564,7 @@ EndPointIs=SOAP clients must send their requests to the Dolibarr endpoint availa
ApiSetup=API module setup
ApiDesc=By enabling this module, Dolibarr become a REST server to provide miscellaneous web services.
KeyForApiAccess=Key to use API (parameter "api_key")
ApiProductionMode=Enable production mode
ApiEndPointIs=You can access to the API at url
ApiExporerIs=You can explore the API at url
OnlyActiveElementsAreExposed=Only elements from enabled modules are exposed
@ -1597,6 +1598,7 @@ ProjectsSetup=Project module setup
ProjectsModelModule=Project reports document model
TasksNumberingModules=Tasks numbering module
TaskModelModule=Tasks reports document model
UseSearchToSelectProject=Use autocompletion fields to choose project (instead of using a list box)
##### ECM (GED) #####
ECMSetup = GED Setup
ECMAutoTree = Automatic tree folder and document

View File

@ -95,3 +95,5 @@ AddEvent=Create event
MyAvailability=My availability
ActionType=Event type
DateActionBegin=Start event date
CloneAction=Clone event
ConfirmCloneEvent=Are you sure you want to clone the event <b>%s</b> ?

View File

@ -30,6 +30,7 @@ ThirdPartyContact=Third party contact/address
StatusContactValidated=Status of contact/address
Company=Company
CompanyName=Company name
AliasNames=Alias names (commercial, trademark, ...)
Companies=Companies
CountryIsInEEC=Country is inside European Economic Community
ThirdPartyName=Third party name

View File

@ -128,6 +128,7 @@ TagCheckMail=Track mail opening
TagUnsubscribe=Unsubscribe link
TagSignature=Signature sending user
TagMailtoEmail=Recipient EMail
NoEmailSentBadSenderOrRecipientEmail=No email sent. Bad sender or recipient email. Verify user profile.
# Module Notifications
Notifications=Notifications
NoNotificationsWillBeSent=No email notifications are planned for this event and company

View File

@ -96,3 +96,5 @@ AddEvent=Créer un événement
MyAvailability=Ma disponibilité
ActionType=Type événement
DateActionBegin=Date début événément
CloneAction=Cloner événement
ConfirmCloneAction=Êtes-vous sûr de vouloir cloner l'événement <b>%s</b> ?

View File

@ -1526,33 +1526,33 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
if ((( ! empty($conf->societe->enabled) && (empty($conf->global->SOCIETE_DISABLE_PROSPECTS) || empty($conf->global->SOCIETE_DISABLE_CUSTOMERS))) || ! empty($conf->fournisseur->enabled)) && ! empty($conf->global->MAIN_SEARCHFORM_SOCIETE) && $user->rights->societe->lire)
{
$langs->load("companies");
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', img_object('','company').' '.$langs->trans("ThirdParties"), 'soc', 'socname', 'T', 'searchleftt');
$searchform.=printSearchForm(DOL_URL_ROOT.'/societe/societe.php', DOL_URL_ROOT.'/societe/societe.php', $langs->trans("ThirdParties"), 'soc', 'socname', 'T', 'searchleftt', img_object('','company'));
}
if (! empty($conf->societe->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_CONTACT) && $user->rights->societe->lire)
{
$langs->load("companies");
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', img_object('','contact').' '.$langs->trans("Contacts"), 'contact', 'contactname', '', 'searchleftc');
$searchform.=printSearchForm(DOL_URL_ROOT.'/contact/list.php', DOL_URL_ROOT.'/contact/list.php', $langs->trans("Contacts"), 'contact', 'contactname', '', 'searchleftc', img_object('','contact'));
}
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire))
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE))
{
$langs->load("products");
$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', img_object('','product').' '.$langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp');
$searchform.=printSearchForm(DOL_URL_ROOT.'/product/list.php', DOL_URL_ROOT.'/product/list.php', $langs->trans("Products")."/".$langs->trans("Services"), 'products', 'sall', 'P', 'searchleftp', img_object('','product'));
}
if (((! empty($conf->product->enabled) && $user->rights->produit->lire) || (! empty($conf->service->enabled) && $user->rights->service->lire)) && ! empty($conf->fournisseur->enabled)
&& ! empty($conf->global->MAIN_SEARCHFORM_PRODUITSERVICE_SUPPLIER))
{
$langs->load("products");
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', img_object('','product').' '.$langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts');
$searchform.=printSearchForm(DOL_URL_ROOT.'/fourn/product/list.php', DOL_URL_ROOT.'/fourn/product/list.php', $langs->trans("SupplierRef"), 'products', 'srefsupplier', '', 'searchlefts', img_object('','product'));
}
if (! empty($conf->adherent->enabled) && ! empty($conf->global->MAIN_SEARCHFORM_ADHERENT) && $user->rights->adherent->lire)
{
$langs->load("members");
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', img_object('','user').' '.$langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm');
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/list.php', DOL_URL_ROOT.'/adherents/list.php', $langs->trans("Members"), 'member', 'sall', 'M', 'searchleftm', img_object('','user'));
}
// Execute hook printSearchForm
@ -1797,9 +1797,10 @@ function getHelpParamFor($helppagename,$langs)
* @param string $htmlinputname Field Name input form
* @param string $accesskey Accesskey
* @param string $idname Complement for id to avoid multiple same id in the page
* @param string $img Image to use
* @return string
*/
function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinputname,$accesskey='', $idname='')
function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinputname,$accesskey='', $idname='',$img='')
{
global $conf,$langs;
@ -1809,10 +1810,13 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput
$ret='';
$ret.='<form action="'.$urlaction.'" method="post">';
$ret.='<div class="menu_titre menu_titre_search">';
$ret.='<div class="menu_titre menu_titre_search"';
if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=' style="display: inline-block"';
$ret.='>';
$ret.='<label for="'.$idname.$htmlinputname.'">';
$ret.='<a class="vsmenu" href="'.$urlobject.'">';
$ret.=$title;
if ($img && ! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=$img;
else $ret.=$img.' '.$title;
$ret.='</a>';
$ret.='</label>';
$ret.='</div>';
@ -1821,7 +1825,7 @@ function printSearchForm($urlaction,$urlobject,$title,$htmlmodesearch,$htmlinput
$ret.='<input type="hidden" name="mode_search" value="'.$htmlmodesearch.'">';
$ret.='<input type="text" class="flat"';
$ret.=($accesskey?' accesskey="'.$accesskey.'"':'');
if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=' placeholder="'.$langs->trans("SearchOf").''.strip_tags($title).'"';
if (! empty($conf->global->MAIN_HTML5_PLACEHOLDER)) $ret.=' placeholder="'.strip_tags($title).'"'; // Will work only if MAIN_HTML5_PLACEHOLDER is set to 1
else $ret.=' title="'.$langs->trans("SearchOf").''.strip_tags($title).'"';
$ret.=' name="'.$htmlinputname.'" id="'.$idname.$htmlinputname.'" size="10" />';
$ret.='<input type="submit" class="button" style="padding-top: 4px; padding-bottom: 4px; padding-left: 6px; padding-right: 6px" value="'.$langs->trans("Go").'">';

View File

@ -5,6 +5,7 @@
* Copyright (C) 2011-2013 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -280,6 +281,14 @@ else if ($action == 'setmodtask')
dolibarr_set_const($db, "PROJECT_TASK_ADDON",$value,'chaine',0,'',$conf->entity);
}
elseif ($action == 'updateoptions') {
if (GETPOST('PROJECT_USE_SEARCH_TO_SELECT')) {
$companysearch = GETPOST('activate_PROJECT_USE_SEARCH_TO_SELECT', 'alpha');
if (dolibarr_set_const($db, "PROJECT_USE_SEARCH_TO_SELECT", $companysearch, 'chaine', 0, '', $conf->entity)) {
$conf->global->PROJECT_USE_SEARCH_TO_SELECT = $companysearch;
}
}
}
/*
@ -813,6 +822,47 @@ foreach ($dirmodels as $reldir)
print '</table><br/>';
print_titre($langs->trans("Other"));
// Other options
$form=new Form($db);
$var=true;
print '<form method="POST" action="'.$_SERVER['PHP_SELF'].'">';
print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
print '<input type="hidden" name="action" value="updateoptions">';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print "<td>".$langs->trans("Parameters")."</td>\n";
print '<td align="right" width="60">'.$langs->trans("Value").'</td>'."\n";
print '<td width="80">&nbsp;</td></tr>'."\n";
$var=!$var;
print "<tr ".$bc[$var].">";
print '<td width="80%">'.$langs->trans("UseSearchToSelectProject").'</td>';
if (! $conf->use_javascript_ajax)
{
print '<td class="nowrap" align="right" colspan="2">';
print $langs->trans("NotAvailableWhenAjaxDisabled");
print "</td>";
}
else
{
print '<td width="60" align="right">';
$arrval=array('0'=>$langs->trans("No"),
'1'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",1).')',
'2'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",2).')',
'3'=>$langs->trans("Yes").' ('.$langs->trans("NumberOfKeyToSearch",3).')',
);
print $form->selectarray("activate_PROJECT_USE_SEARCH_TO_SELECT",$arrval,$conf->global->PROJECT_USE_SEARCH_TO_SELECT);
print '</td><td align="right">';
print '<input type="submit" class="button" name="PROJECT_USE_SEARCH_TO_SELECT" value="'.$langs->trans("Modify").'">';
print "</td>";
}
print '</tr></table></form>';
$db->close();
llxFooter();

View File

@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2001-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2010 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Bariley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
@ -100,6 +100,12 @@ if (GETPOST("button_removefilter_x") || GETPOST("button_removefilter")) // Both
$syear="";
}
// Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array
$hookmanager->initHooks(array('projectlist'));
/*
* View
*/
@ -212,10 +218,7 @@ if ($resql)
if ($mine) $text=$langs->trans('MyProjects');
print_barre_liste($text, $page, $_SERVER["PHP_SELF"], "", $sortfield, $sortorder, "", $num,'','title_project');
print '<form method="get" action="'.$_SERVER["PHP_SELF"].'">';
print '<table class="noborder" width="100%">';
print '<form method="GET" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">';
// Show description of content
if ($mine) print $langs->trans("MyProjectsDesc").'<br><br>';
@ -242,13 +245,16 @@ if ($resql)
}
if (! empty($moreforfilter))
{
print '<tr class="liste_titre">';
print '<td class="liste_titre" colspan="10">';
print '<div class="liste_titre">';
print $moreforfilter;
print '</td></tr>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldPreListTitle',$parameters); // Note that $action and $object may have been modified by hook
print '</div>';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),$_SERVER["PHP_SELF"],"p.ref","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Label"),$_SERVER["PHP_SELF"],"p.title","",$param,"",$sortfield,$sortorder);
@ -259,6 +265,8 @@ if ($resql)
print_liste_field_titre($langs->trans("Visibility"),$_SERVER["PHP_SELF"],"p.public","",$param,"",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],'p.fk_statut',"",$param,'align="right"',$sortfield,$sortorder);
print_liste_field_titre('');
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListTitle',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
print '<tr class="liste_titre">';
@ -301,6 +309,11 @@ if ($resql)
print '<input type="image" class="liste_titre" name="button_removefilter" src="'.img_picto($langs->trans("RemoveFilter"),'searchclear.png','','',1).'" value="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'" title="'.dol_escape_htmltag($langs->trans("RemoveFilter")).'">';
print '</td>';
$parameters=array();
$formconfirm=$hookmanager->executeHooks('printFieldListOption',$parameters); // Note that $action and $object may have been modified by hook
print '</tr>'."\n";
while ($i < $num)
{
$objp = $db->fetch_object($resql);
@ -396,21 +409,29 @@ if ($resql)
$projectstatic->statut = $objp->fk_statut;
print '<td align="right" colspan="2">'.$projectstatic->getLibStatut(5).'</td>';
$parameters=array('obj' => $objp);
$formconfirm=$hookmanager->executeHooks('printFieldListValue',$parameters); // Note that $action and $object may have been modified by hook
print "</tr>\n";
}
$i++;
}
$db->free($resql);
}
$db->free($resql);
$parameters=array('sql' => $sql);
$formconfirm=$hookmanager->executeHooks('printFieldListFooter',$parameters); // Note that $action and $object may have been modified by hook
print "</table>\n";
print "</form>\n";
}
else
{
dol_print_error($db);
}
print "</table>";
llxFooter();

View File

@ -0,0 +1,15 @@
#
# Apache configuration file to use API
#
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ index.php [QSA,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
<IfModule mod_php5.c>
php_flag display_errors On
</IfModule>

View File

@ -28,8 +28,7 @@
if (! defined("NOLOGIN")) define("NOLOGIN",'1');
$res=0;
if (! $res && file_exists("../../main.inc.php")) $res=@include '../../main.inc.php';
if (! $res && file_exists("../../../dolibarr/htdocs/main.inc.php")) $res=@include '../../../dolibarr/htdocs/main.inc.php'; // For custom directory
if (! $res && file_exists("../../main.inc.php")) $res=include '../../main.inc.php';
if (! $res) die("Include of main fails");
require_once DOL_DOCUMENT_ROOT.'/includes/restler/vendor/autoload.php';
@ -48,7 +47,6 @@ if (empty($conf->global->MAIN_MODULE_API))
}
use \Luracast\Restler\Defaults;
Defaults::setProperty('authenticationMethod','_isAllowed');
$api = new DolibarrApi($db);
@ -113,12 +111,12 @@ foreach ($modulesdir as $dir)
$classname=$reg[1];
$classname = str_replace('Api_','',ucwords($reg[1])).'Api';
require_once $dir_part.$file_searched;
if(class_exists($classname))
if(class_exists($classname)) {
$api->r->addAPIClass($classname,'');
}
}
}
}
}
}
}

View File

@ -5,6 +5,7 @@
* Copyright (C) 2006-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2007 Patrick Raguin <patrick.raguin@gmail.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -85,6 +86,11 @@ if ($socid)
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';

View File

@ -63,8 +63,15 @@ class Societe extends CommonObject
*/
public $nom;
public $firstname;
public $lastname;
var $firstname;
var $lastname;
/**
* Alias names (commercial, trademark or alias names)
* @var string
*/
public $name_alias;
public $particulier;
public $civility_id;
public $address;
@ -451,8 +458,8 @@ class Societe extends CommonObject
if ($result >= 0)
{
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key)";
$sql.= " VALUES ('".$this->db->escape($this->name)."', ".$conf->entity.", '".$this->db->idate($now)."'";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."societe (nom, name_alias, entity, datec, fk_user_creat, canvas, status, ref_int, ref_ext, fk_stcomm, fk_incoterms, location_incoterms ,import_key)";
$sql.= " VALUES ('".$this->db->escape($this->name)."', '".$this->db->escape($this->name_alias)."', ".$conf->entity.", '".$this->db->idate($now)."'";
$sql.= ", ".(! empty($user->id) ? "'".$user->id."'":"null");
$sql.= ", ".(! empty($this->canvas) ? "'".$this->canvas."'":"null");
$sql.= ", ".$this->status;
@ -666,6 +673,7 @@ class Societe extends CommonObject
$this->id = $id;
$this->name = $this->name?trim($this->name):trim($this->nom);
$this->nom = $this->name; // For backward compatibility
$this->name_alias = trim($this->name_alias);
$this->ref_ext = trim($this->ref_ext);
$this->address = $this->address?trim($this->address):trim($this->address);
$this->zip = $this->zip?trim($this->zip):trim($this->zip);
@ -777,6 +785,7 @@ class Societe extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."societe SET ";
$sql .= "nom = '" . $this->db->escape($this->name) ."'"; // Required
$sql .= ",name_alias = '" . $this->db->escape($this->name_alias) ."'";
$sql .= ",ref_ext = " .(! empty($this->ref_ext)?"'".$this->db->escape($this->ref_ext) ."'":"null");
$sql .= ",address = '" . $this->db->escape($this->address) ."'";
@ -999,7 +1008,7 @@ class Societe extends CommonObject
if (empty($rowid) && empty($ref) && empty($ref_ext) && empty($ref_int)) return -1;
$sql = 'SELECT s.rowid, s.nom as name, s.entity, s.ref_ext, s.ref_int, s.address, s.datec as date_creation, s.prefix_comm';
$sql = 'SELECT s.rowid, s.nom as name, s.name_alias, s.entity, s.ref_ext, s.ref_int, s.address, s.datec as date_creation, s.prefix_comm';
$sql .= ', s.status';
$sql .= ', s.price_level';
$sql .= ', s.tms as date_modification';
@ -1060,6 +1069,7 @@ class Societe extends CommonObject
$this->ref = $obj->rowid;
$this->name = $obj->name;
$this->nom = $obj->name; // deprecated
$this->name_alias = $obj->name_alias;
$this->ref_ext = $obj->ref_ext;
$this->ref_int = $obj->ref_int;
@ -1782,6 +1792,10 @@ class Societe extends CommonObject
$name =$code.' '.$name;
}
if (!empty($this->name_alias)) {
$name .= ' ('.$this->name_alias.')';
}
$result=''; $label='';
$link=''; $linkend='';
@ -2130,7 +2144,6 @@ class Societe extends CommonObject
return $bac->getRibLabel(true);
}
/**
* Return Array of RIB
*

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2012-2013 Philippe Berthet <berthet@systune.be>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2013-2015 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* Version V1.1 Initial version of Philippe Berthet
* Version V2 Change to be compatible with 3.4 and enhanced to be more generic
@ -119,6 +120,10 @@ print '<td colspan="3">';
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr id="name_alias"><td valign="top"><label for="name_alias_input">'.$langs->trans('AliasNames').'</label></td>';
print '<td colspan="3"><input type="text" name="name_alias" id="name_alias_input" value="'.dol_escape_htmltag($object->name_alias).'" size="32"></td></tr>';
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -117,6 +118,11 @@ if ($object->id)
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2013 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -81,6 +82,11 @@ if ($id > 0)
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';

View File

@ -2,6 +2,7 @@
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -148,6 +149,11 @@ if ($result > 0)
print $form->showrefnav($object,'socid','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -136,6 +137,11 @@ print '<tr><td width="25%">' . $langs->trans("ThirdPartyName") . '</td><td colsp
print $form->showrefnav($soc, 'socid', '', ($user->societe_id ? 0 : 1), 'rowid', 'nom');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $soc->name_alias;
print "</td></tr>";
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>' . $langs->trans('Prefix') . '</td><td colspan="3">' . $soc->prefix_comm . '</td></tr>';

View File

@ -159,10 +159,6 @@ if (empty($reshook))
}
//External modules should update their ones too
$hookmanager->initHooks(array(
'mergethirds'
));
if (!$errors)
{
$reshook = $hookmanager->executeHooks('replaceThirdparty', array(
@ -251,7 +247,9 @@ if (empty($reshook))
else
{
$object->name = GETPOST('name', 'alpha');
$object->name_alias = GETPOST('name_alias');
}
$object->address = GETPOST('address', 'alpha');
$object->zip = GETPOST('zipcode', 'alpha');
$object->town = GETPOST('town', 'alpha');
@ -915,6 +913,7 @@ else
$("#radiocompany").click(function() {
$(".individualline").hide();
$("#typent_id").val(0);
$("#name_alias").show();
$("#effectif_id").val(0);
$("#TypeName").html(document.formsoc.ThirdPartyName.value);
document.formsoc.private.value=0;
@ -922,6 +921,7 @@ else
$("#radioprivate").click(function() {
$(".individualline").show();
$("#typent_id").val(id_te_private);
$("#name_alias").hide();
$("#effectif_id").val(id_ef15);
$("#TypeName").html(document.formsoc.LastName.value);
document.formsoc.private.value=1;
@ -1053,6 +1053,10 @@ else
print '</td></tr>';
}
// Alias names (commercial, trademark or alias names)
print '<tr id="name_alias"><td><label for="name_alias_input">'.$langs->trans('AliasNames').'</label></td>';
print '<td colspan="3"><input type="text" name="name_alias" id="name_alias_input" value="'.$object->name_alias.'" size="32"></td></tr>';
// Address
print '<tr><td class="tdtop">'.fieldLabel('Address','address').'</td>';
print '<td colspan="3"><textarea name="address" id="address" cols="80" rows="'._ROWS_2.'" wrap="soft">';
@ -1467,6 +1471,10 @@ else
print '<tr><td>'.fieldLabel('ThirdPartyName','name',1).'</td>';
print '<td colspan="3"><input type="text" size="60" maxlength="128" name="name" id="name" value="'.dol_escape_htmltag($object->name).'" autofocus="autofocus"></td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr id="name_alias"><td><label for="name_alias_input">'.$langs->trans('AliasNames').'</label></td>';
print '<td colspan="3"><input type="text" name="name_alias" id="name_alias_input" value="'.dol_escape_htmltag($object->name_alias).'" size="32"></td></tr>';
// Prefix
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
@ -1880,6 +1888,11 @@ else
print '</td>';
print '</tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td>'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
// Logo+barcode
$rowspan=6;
if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++;

View File

@ -85,20 +85,22 @@ if ($mode == 'search')
// For natural search
$scrit = explode(' ', $socname);
$fields = array(
's.nom',
's.code_client',
's.email',
's.url',
's.siren',
's.name_alias'
);
if (!empty($conf->barcode->enabled)) {
$fields[] = 's.barcode';
}
foreach ($scrit as $crit) {
$sql.= " AND (";
$sql.= " s.nom LIKE '%".$db->escape($crit)."%'";
$sql.= " OR s.code_client LIKE '%".$db->escape($crit)."%'";
$sql.= " OR s.email LIKE '%".$db->escape($crit)."%'";
$sql.= " OR s.url LIKE '%".$db->escape($crit)."%'";
$sql.= " OR s.siren LIKE '%".$db->escape($crit)."%'";
if (!empty($conf->barcode->enabled))
{
$sql.= "OR s.barcode LIKE '".$db->escape($crit)."'";
}
$sql.= ")";
$sql.= natural_search($fields, $crit);
}
if (!$user->rights->societe->client->voir && !$socid) $sql.= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;

View File

@ -4,6 +4,7 @@
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2011-2012 Philippe Grand <philippe.grand@atoo-net.com>
* Copyright (C) 2014 Charles-Fr Benke <charles.fr@benke.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
*
* 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
@ -153,6 +154,11 @@ if ($id > 0 || ! empty($ref))
print $form->showrefnav($object,'id','',($user->societe_id?0:1),'rowid','nom');
print '</td></tr>';
// Alias names (commercial, trademark or alias names)
print '<tr><td valign="top">'.$langs->trans('AliasNames').'</td><td colspan="3">';
print $object->name_alias;
print "</td></tr>";
if (! empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
{
print '<tr><td>'.$langs->trans('Prefix').'</td><td colspan="3">'.$object->prefix_comm.'</td></tr>';

View File

@ -124,7 +124,7 @@ if (empty($conf->global->THEME_ELDY_ENABLE_PERSONALIZED))
$conf->global->THEME_ELDY_BACKTABCARD1='255,255,255';
$conf->global->THEME_ELDY_BACKTABCARD2='210,210,210'; // card
$conf->global->THEME_ELDY_BACKTABACTIVE='234,234,234';
$conf->global->THEME_ELDY_BACKBODY='243,243,243;';
$conf->global->THEME_ELDY_BACKBODY='243,243,243';
$conf->global->THEME_ELDY_LINEIMPAIR1='255,255,255';
$conf->global->THEME_ELDY_LINEIMPAIR2='255,255,255';
$conf->global->THEME_ELDY_LINEIMPAIRHOVER='238,246,252';
@ -1114,6 +1114,14 @@ div.blockvmenusearch
box-shadow: 3px 3px 4px #DDD;
}
div.blockvmenusearch > form > div {
/* min-height: 40px; */
padding-top: 3px;
}
div.blockvmenusearch > form > div > label {
padding-right: 2px;
}
div.blockvmenuhelp
{
<?php if (empty($conf->dol_optimize_smallscreen)) { ?>

View File

@ -1816,14 +1816,15 @@ class User extends CommonObject
* Return a link to the user card (with optionaly the picto)
* Use this->id,this->lastname, this->firstname
*
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to
* @param integer $infologin Add connection info to the tooltip
* @param integer $notooltip 1=Disable tooltip
* @param int $maxlen Max length of visible user name
* @return string String with URL
* @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
* @param string $option On what the link point to
* @param integer $infologin Add connection info to the tooltip
* @param integer $notooltip 1=Disable tooltip
* @param int $maxlen Max length of visible user name
* @param int $hidethirdpartylogo Hide logo of thirdparty if user is external user
* @return string String with URL
*/
function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen=24)
function getNomUrl($withpicto=0, $option='', $infologin=0, $notooltip=0, $maxlen=24, $hidethirdpartylogo=0)
{
global $langs, $conf, $db;
global $dolibarr_main_authentication, $dolibarr_main_demo;
@ -1841,11 +1842,11 @@ class User extends CommonObject
$label.= '<br><b>' . $langs->trans("EMail").':</b> '.$this->email;
if (! empty($this->admin))
$label.= '<br><b>' . $langs->trans("Administrator").'</b>: '.yn($this->admin);
if (! empty($this->societe_id)) // Add thirdparty for external users
if (! empty($this->societe_id) ) // Add thirdparty for external users
{
$thirdpartystatic = new Societe($db);
$thirdpartystatic->fetch($this->societe_id);
$companylink = ' '.$thirdpartystatic->getNomUrl(2); // picto only of company
if (empty($hidethirdpartylogo)) $companylink = ' '.$thirdpartystatic->getNomUrl(2); // picto only of company
$company=' ('.$langs->trans("Company").': '.$thirdpartystatic->name.')';
}
$type=($this->societe_id?$langs->trans("External").$company:$langs->trans("Internal"));
@ -2340,7 +2341,7 @@ class User extends CommonObject
$this->load_parentof();
// Init $this->users array
$sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.login, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates
$sql = "SELECT DISTINCT u.rowid, u.firstname, u.lastname, u.fk_user, u.fk_soc, u.login, u.email, u.gender, u.statut, u.entity"; // Distinct reduce pb with old tables with duplicates
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
if(! empty($conf->multicompany->enabled) && $conf->entity == 1 && (! empty($conf->multicompany->transverse_mode) || (! empty($user->admin) && empty($user->entity))))
{
@ -2360,11 +2361,14 @@ class User extends CommonObject
$this->users[$obj->rowid]['rowid'] = $obj->rowid;
$this->users[$obj->rowid]['id'] = $obj->rowid;
$this->users[$obj->rowid]['fk_user'] = $obj->fk_user;
$this->users[$obj->rowid]['fk_soc'] = $obj->fk_soc;
$this->users[$obj->rowid]['firstname'] = $obj->firstname;
$this->users[$obj->rowid]['lastname'] = $obj->lastname;
$this->users[$obj->rowid]['login'] = $obj->login;
$this->users[$obj->rowid]['statut'] = $obj->statut;
$this->users[$obj->rowid]['entity'] = $obj->entity;
$this->users[$obj->rowid]['email'] = $obj->email;
$this->users[$obj->rowid]['gender'] = $obj->gender;
$i++;
}
}

View File

@ -78,6 +78,9 @@ foreach($fulltree as $key => $val)
$userstatic->firstname=$val['firstname'];
$userstatic->lastname=$val['lastname'];
$userstatic->statut=$val['statut'];
$userstatic->email=$val['email'];
$userstatic->gender=$val['gender'];
$userstatic->societe_id=$val['fk_soc'];
$entity=$val['entity'];
$entitystring='';

View File

@ -83,7 +83,7 @@ $buttonviewhierarchy='<form action="'.DOL_URL_ROOT.'/user/hierarchy.php" method=
print_fiche_titre($langs->trans("ListOfUsers"), $buttonviewhierarchy);
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login,";
$sql = "SELECT u.rowid, u.lastname, u.firstname, u.admin, u.fk_soc, u.login, u.email, u.gender,";
$sql.= " u.datec,";
$sql.= " u.tms as datem,";
$sql.= " u.datelastlogin,";
@ -168,8 +168,21 @@ if ($result)
$obj = $db->fetch_object($result);
$var=!$var;
$userstatic->id=$obj->id;
$userstatic->ref=$obj->label;
$userstatic->login=$obj->login;
$userstatic->statut=$obj->statut;
$userstatic->email=$obj->email;
$userstatic->gender=$obj->gender;
$userstatic->societe_id=$obj->fk_soc;
$userstatic->firstname='';
$userstatic->lastname=$obj->login;
$li=$userstatic->getNomUrl(1,'',0,0,24,1);
print "<tr ".$bc[$var].">";
print '<td><a href="card.php?id='.$obj->rowid.'">'.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'</a>';
print '<td>';
print $li;
if (! empty($conf->multicompany->enabled) && $obj->admin && ! $obj->entity)
{
print img_picto($langs->trans("SuperAdministrator"),'redstar');