diff --git a/build/rpm/dolibarr_opensuse.spec b/build/rpm/dolibarr_opensuse.spec index d144134ae6a..d2109442024 100755 --- a/build/rpm/dolibarr_opensuse.spec +++ b/build/rpm/dolibarr_opensuse.spec @@ -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 diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index ab7fd2a510c..8342613208e 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -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 ''; - // Company - print ''; - print ''; + // Thirdparty - Contact + if ($conf->societe->enabled) + { + print ''; + print ''; - // Contact - print ''; + // Contact + print ''; + } // Project if (! empty($conf->projet->enabled)) @@ -803,7 +806,7 @@ if ($id) // Projet associe $langs->load("project"); - print ''; @@ -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 '
'.$langs->trans("ActionOnCompany").''; - print $form->select_company($act->societe->id,'socid','',1,1); - print '
'.$langs->trans("ActionOnCompany").''; + print $form->select_company($act->societe->id,'socid','',1,1); + print ''.$langs->trans("Contact").''; - print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1); - print '
'.$langs->trans("Contact").''; + print $form->selectarray("contactid", (empty($act->societe->id)?array():$act->societe->contact_array()), $act->contact->id, 1); + print '
'.$langs->trans("Project").''; + print '
'.$langs->trans("Project").''; $numprojet=select_projects($act->societe->id,$act->fk_project,'projectid'); if ($numprojet==0) { @@ -813,7 +816,7 @@ if ($id) } // Priority - print '
'.$langs->trans("Priority").''; + print '
'.$langs->trans("Priority").''; print ''; print '
'; if (empty($reshook) && ! empty($extrafields->attribute_label)) @@ -852,7 +855,7 @@ if ($id) } print '

'; } - + print '

'; print '     '; @@ -958,39 +961,41 @@ if ($id) print '

'; // Third party - Contact - print ''; - print ''; - print ''; + print ''; + print ''; } - else - { - print $langs->trans("None"); - } - - print ''; // Project if (! empty($conf->projet->enabled)) { - print ''; @@ -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 '
'.$langs->trans("ActionOnCompany").''.($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 '
'.$langs->trans("ActionOnCompany").''.($act->societe->id?$act->societe->getNomUrl(1):$langs->trans("None")); + if ($act->societe->id && $act->type_code == 'AC_TEL') { - print "
".dol_print_phone($act->societe->tel); - } - } - print '
'.$langs->trans("Contact").''; - 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 "
".dol_print_phone($act->contact->phone_pro); + print "
".dol_print_phone($act->societe->tel); } } + print '
'.$langs->trans("Contact").''; + 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 "
".dol_print_phone($act->contact->phone_pro); + } + } + } + else + { + print $langs->trans("None"); + } + print '
'.$langs->trans("Project").''; + print '
'.$langs->trans("Project").''; if ($act->fk_project) { $project=new Project($db); @@ -1001,7 +1006,7 @@ if ($id) } // Priority - print '
'.$langs->trans("Priority").''; + print '
'.$langs->trans("Priority").''; print ($act->priority?$act->priority:''); print '
'; - + //Extra field if (empty($reshook) && ! empty($extrafields->attribute_label)) - { + { print '

'; foreach($extrafields->attribute_label as $key=>$label) { diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index f8ba6f4b0f9..dc1a902ea2a 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -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]; diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 0d48dc1cef2..f3f2b3a6179 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -1,7 +1,7 @@ * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Eric Seigne * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2005 Lionel Cousteix @@ -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 ''.$langs->trans("DeleteUser").''; + if ($user->admin || ! $object->admin) // If user edited is admin, delete is possible on for an admin + { + print ''.$langs->trans("DeleteUser").''; + } + else + { + print ''.$langs->trans("DeleteUser").''; + } } print "\n";