Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop

This commit is contained in:
Laurent Destailleur 2012-12-27 11:14:11 +01:00
commit 35ee168d9a
4 changed files with 70 additions and 47 deletions

View File

@ -27,7 +27,9 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
Group: Productivity/Office/Management
Requires: apache2, apache2-mod_php5, php5 >= 5.3.0, php5-gd, php5-ldap, php5-imap, php5-mysql, php5-openssl, dejavu
Requires: mysql-community-server, mysql-community-server-client
%if 0%{?suse_version}
BuildRequires: update-desktop-files fdupes
%endif
# Set yes to build test package, no for release (this disable need of /usr/bin/php not found by OpenSuse)
AutoReqProv: no
@ -119,6 +121,7 @@ do
fi
done >>%{name}.lang
%if 0%{?suse_version}
# Enable this command to tag desktop file for suse
%suse_update_desktop_file dolibarr
@ -126,6 +129,8 @@ done >>%{name}.lang
# Enable this command to allow suse detection of duplicate files and create hardlinks instead
%fdupes $RPM_BUILD_ROOT%{_datadir}/%{name}/htdocs
%endif
#---- clean
%clean

View File

@ -352,7 +352,7 @@ if ($action == 'update')
$actioncomm->array_options[$key]=GETPOST($key);
}
}
if (! $error)
{
$db->begin();
@ -646,7 +646,7 @@ if ($id)
$act = new ActionComm($db);
$result=$act->fetch($id);
$act->fetch_optionals($id,$extralabels);
if ($result < 0)
{
dol_print_error($db,$act->error);
@ -786,16 +786,19 @@ if ($id)
print '<table class="border" width="100%">';
// Company
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td>';
print '<td>';
print $form->select_company($act->societe->id,'socid','',1,1);
print '</td>';
// Thirdparty - Contact
if ($conf->societe->enabled)
{
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td>';
print '<td>';
print $form->select_company($act->societe->id,'socid','',1,1);
print '</td>';
// Contact
print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1);
print '</td></tr>';
// Contact
print '<td>'.$langs->trans("Contact").'</td><td width="30%">';
print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1);
print '</td></tr>';
}
// Project
if (! empty($conf->projet->enabled))
@ -803,7 +806,7 @@ if ($id)
// Projet associe
$langs->load("project");
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
$numprojet=select_projects($act->societe->id,$act->fk_project,'projectid');
if ($numprojet==0)
{
@ -813,7 +816,7 @@ if ($id)
}
// Priority
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
print '<tr><td nowrap width="30%">'.$langs->trans("Priority").'</td><td colspan="3">';
print '<input type="text" name="priority" value="'.($act->priority?$act->priority:'').'" size="5">';
print '</td></tr>';
@ -835,7 +838,7 @@ if ($id)
// Other attributes
$parameters=array('colspan' => ' colspan="3"', 'colspanvalue' => '3');
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
print '</table>';
if (empty($reshook) && ! empty($extrafields->attribute_label))
@ -852,7 +855,7 @@ if ($id)
}
print '</table><br><br>';
}
print '<center><br><input type="submit" class="button" name="edit" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; <input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
@ -958,39 +961,41 @@ if ($id)
print '</table><br><br><table class="border" width="100%">';
// Third party - Contact
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
if ($act->societe->id && $act->type_code == 'AC_TEL')
{
if ($act->societe->fetch($act->societe->id))
if ($conf->societe->enabled)
{
print '<tr><td width="30%">'.$langs->trans("ActionOnCompany").'</td><td>'.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None"));
if ($act->societe->id && $act->type_code == 'AC_TEL')
{
print "<br>".dol_print_phone($act->societe->tel);
}
}
print '</td>';
print '<td>'.$langs->trans("Contact").'</td>';
print '<td>';
if ($act->contact->id > 0)
{
print $act->contact->getNomUrl(1);
if ($act->contact->id && $act->type_code == 'AC_TEL')
{
if ($act->contact->fetch($act->contact->id))
if ($act->societe->fetch($act->societe->id))
{
print "<br>".dol_print_phone($act->contact->phone_pro);
print "<br>".dol_print_phone($act->societe->tel);
}
}
print '</td>';
print '<td>'.$langs->trans("Contact").'</td>';
print '<td>';
if ($act->contact->id > 0)
{
print $act->contact->getNomUrl(1);
if ($act->contact->id && $act->type_code == 'AC_TEL')
{
if ($act->contact->fetch($act->contact->id))
{
print "<br>".dol_print_phone($act->contact->phone_pro);
}
}
}
else
{
print $langs->trans("None");
}
print '</td></tr>';
}
else
{
print $langs->trans("None");
}
print '</td></tr>';
// Project
if (! empty($conf->projet->enabled))
{
print '<tr><td valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
print '<tr><td width="30%" valign="top">'.$langs->trans("Project").'</td><td colspan="3">';
if ($act->fk_project)
{
$project=new Project($db);
@ -1001,7 +1006,7 @@ if ($id)
}
// Priority
print '<tr><td nowrap>'.$langs->trans("Priority").'</td><td colspan="3">';
print '<tr><td nowrap width="30%">'.$langs->trans("Priority").'</td><td colspan="3">';
print ($act->priority?$act->priority:'');
print '</td></tr>';
@ -1022,10 +1027,10 @@ if ($id)
$reshook=$hookmanager->executeHooks('formObjectOptions',$parameters,$act,$action); // Note that $action and $object may have been modified by hook
print '</table>';
//Extra field
if (empty($reshook) && ! empty($extrafields->attribute_label))
{
{
print '<br><br><table class="border" width="100%">';
foreach($extrafields->attribute_label as $key=>$label)
{

View File

@ -3317,15 +3317,21 @@ function migrate_mode_reglement($db,$langs,$conf)
$db->begin();
$sqla = "UPDATE ".MAIN_DB_PREFIX."paiement SET ";
$sqla.= "fk_paiement = ".$elements['new_id'][$key];
$sqla.= " WHERE fk_paiement = ".$old_id;
$sqla.= " AND fk_paiement IN (SELECT id FROM ".MAIN_DB_PREFIX."c_paiement WHERE id = ".$old_id." AND code = '".$elements['code'][$key]."')";
$resqla = $db->query($sqla);
$sql = "UPDATE ".MAIN_DB_PREFIX."c_paiement SET ";
$sql.= "id = ".$elements['new_id'][$key];
$sql.= " WHERE id = ".$old_id;
$sql.= " AND code = '".$elements['code'][$key]."'";
$resql = $db->query($sql);
if ($resql)
if ($resqla && $resql)
{
foreach($elements['tables'] as $table)
foreach($elements['tables'] as $table) // FIXME We must not update tables if oldid is not renamed
{
$sql = "UPDATE ".MAIN_DB_PREFIX.$table." SET ";
$sql.= "fk_mode_reglement = ".$elements['new_id'][$key];

View File

@ -1,7 +1,7 @@
<?php
/* Copyright (C) 2002-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2002-2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005 Lionel Cousteix <etm_ltd@tiscali.co.uk>
@ -1367,7 +1367,14 @@ else
if ($user->id <> $id && $candisableuser &&
(empty($conf->multicompany->enabled) || ! $user->entity || ($object->entity == $conf->entity) || ($conf->multicompany->transverse_mode && $conf->entity == 1)))
{
print '<a class="butActionDelete" href="fiche.php?action=delete&amp;id='.$object->id.'">'.$langs->trans("DeleteUser").'</a>';
if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin
{
print '<a class="butActionDelete" href="fiche.php?action=delete&amp;id='.$object->id.'">'.$langs->trans("DeleteUser").'</a>';
}
else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("MustBeAdminToDeleteOtherAdmin")).'">'.$langs->trans("DeleteUser").'</a>';
}
}
print "</div>\n";