From bd8e788b611228fcefdaa48226a5d0a8716a58b6 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Tue, 20 Sep 2011 16:56:53 +0000 Subject: [PATCH 1/8] Fix: sql error --- htdocs/fourn/class/fournisseur.facture.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index daf2e07364b..0d98c3ef5ed 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -1206,7 +1206,7 @@ class FactureFournisseur extends Facture */ function initAsSpecimen() { - global $user,$langs,$conf; + global $langs,$conf; $now = dol_now(); @@ -1215,7 +1215,7 @@ class FactureFournisseur extends Facture $sql = "SELECT rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."product"; - $sql.= " AND entity = ".$conf->entity; + $sql.= " WHERE entity = ".$conf->entity; $resql = $this->db->query($sql); if ($resql) From fe5ee88d68764ccd6056af1eadffa22576b1d7b1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 21 Sep 2011 19:42:56 +0200 Subject: [PATCH 2/8] remove eclipse settings directory --- .settings/.jsdtscope | 11 ------ .settings/org.eclipse.core.resources.prefs | 5 --- .settings/org.eclipse.core.runtime.prefs | 3 -- .../org.eclipse.ltk.core.refactoring.prefs | 3 -- .settings/org.eclipse.php.core.prefs | 6 ---- .../org.eclipse.php.core.projectOptions.prefs | 5 --- ...debug.core.Debug_Process_Preferences.prefs | 8 ----- .../org.eclipse.stp.policy.wtp.editor.prefs | 4 --- .settings/org.eclipse.wst.html.core.prefs | 36 ------------------- ...rg.eclipse.wst.jsdt.ui.superType.container | 1 - .../org.eclipse.wst.jsdt.ui.superType.name | 1 - .settings/org.eclipse.wst.validation.prefs | 12 ------- .../org.eclipse.wst.ws.service.policy.prefs | 3 -- .settings/org.eclipse.wst.xsl.core.prefs | 13 ------- .settings/org.sonar.ide.eclipse.prefs | 5 --- 15 files changed, 116 deletions(-) delete mode 100644 .settings/.jsdtscope delete mode 100644 .settings/org.eclipse.core.resources.prefs delete mode 100644 .settings/org.eclipse.core.runtime.prefs delete mode 100644 .settings/org.eclipse.ltk.core.refactoring.prefs delete mode 100644 .settings/org.eclipse.php.core.prefs delete mode 100644 .settings/org.eclipse.php.core.projectOptions.prefs delete mode 100644 .settings/org.eclipse.php.debug.core.Debug_Process_Preferences.prefs delete mode 100644 .settings/org.eclipse.stp.policy.wtp.editor.prefs delete mode 100644 .settings/org.eclipse.wst.html.core.prefs delete mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.container delete mode 100644 .settings/org.eclipse.wst.jsdt.ui.superType.name delete mode 100644 .settings/org.eclipse.wst.validation.prefs delete mode 100644 .settings/org.eclipse.wst.ws.service.policy.prefs delete mode 100644 .settings/org.eclipse.wst.xsl.core.prefs delete mode 100644 .settings/org.sonar.ide.eclipse.prefs diff --git a/.settings/.jsdtscope b/.settings/.jsdtscope deleted file mode 100644 index bbb8e68be8f..00000000000 --- a/.settings/.jsdtscope +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - diff --git a/.settings/org.eclipse.core.resources.prefs b/.settings/org.eclipse.core.resources.prefs deleted file mode 100644 index fcd0ec3ff64..00000000000 --- a/.settings/org.eclipse.core.resources.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Sun Oct 03 22:45:56 CEST 2010 -eclipse.preferences.version=1 -encoding//build/exe/doliwamp/Languages=ISO-8859-1 -encoding//htdocs/langs/fr_FR/other.lang=UTF-8 -encoding/=UTF-8 diff --git a/.settings/org.eclipse.core.runtime.prefs b/.settings/org.eclipse.core.runtime.prefs deleted file mode 100644 index 3f05f297112..00000000000 --- a/.settings/org.eclipse.core.runtime.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri May 08 23:29:39 CEST 2009 -eclipse.preferences.version=1 -line.separator=\n diff --git a/.settings/org.eclipse.ltk.core.refactoring.prefs b/.settings/org.eclipse.ltk.core.refactoring.prefs deleted file mode 100644 index 61a1a86c37e..00000000000 --- a/.settings/org.eclipse.ltk.core.refactoring.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Thu Jul 17 02:14:29 CEST 2008 -eclipse.preferences.version=1 -org.eclipse.ltk.core.refactoring.enable.project.refactoring.history=false diff --git a/.settings/org.eclipse.php.core.prefs b/.settings/org.eclipse.php.core.prefs deleted file mode 100644 index a17f9c6f764..00000000000 --- a/.settings/org.eclipse.php.core.prefs +++ /dev/null @@ -1,6 +0,0 @@ -#Sun Feb 20 12:18:58 CET 2011 -eclipse.preferences.version=1 -include_path= -org.eclipse.php.core.taskCaseSensitive=enabled -org.eclipse.php.core.taskPriorities=NORMAL,HIGH,NORMAL -org.eclipse.php.core.taskTags=TODO,FIXME,@todo diff --git a/.settings/org.eclipse.php.core.projectOptions.prefs b/.settings/org.eclipse.php.core.projectOptions.prefs deleted file mode 100644 index 277f4b8ffa9..00000000000 --- a/.settings/org.eclipse.php.core.projectOptions.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Wed Aug 13 10:35:38 CEST 2008 -eclipse.preferences.version=1 -org.eclipse.php.core.contextRoot= -org.eclipse.php.core.defaultEncoding= -org.eclipse.php.core.includePath=\n\n\n diff --git a/.settings/org.eclipse.php.debug.core.Debug_Process_Preferences.prefs b/.settings/org.eclipse.php.debug.core.Debug_Process_Preferences.prefs deleted file mode 100644 index ae74866c71c..00000000000 --- a/.settings/org.eclipse.php.debug.core.Debug_Process_Preferences.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Wed Oct 20 18:46:50 CEST 2010 -eclipse.preferences.version=1 -org.eclipse.php.debug.core.use-project-settings=true -org.eclipse.php.debug.coredefaultPHP=PHP Linux 5.3.2 -org.eclipse.php.debug.coreoutput_encoding=UTF-8 -org.eclipse.php.debug.corephp_debugger_id=org.eclipse.php.debug.core.xdebugDebugger -org.eclipse.php.debug.corestop_at_first_line_string=true -org.eclipse.php.debug.coretransfer_encoding=UTF-8 diff --git a/.settings/org.eclipse.stp.policy.wtp.editor.prefs b/.settings/org.eclipse.stp.policy.wtp.editor.prefs deleted file mode 100644 index f03ca7036e1..00000000000 --- a/.settings/org.eclipse.stp.policy.wtp.editor.prefs +++ /dev/null @@ -1,4 +0,0 @@ -#Fri May 28 19:41:14 CEST 2010 -eclipse.preferences.version=1 -org.eclipse.stp.policy.wtp.editor.overrides.global=false -org.eclipse.stp.policy.wtp.editor.schema.path=schemas diff --git a/.settings/org.eclipse.wst.html.core.prefs b/.settings/org.eclipse.wst.html.core.prefs deleted file mode 100644 index bb46a503139..00000000000 --- a/.settings/org.eclipse.wst.html.core.prefs +++ /dev/null @@ -1,36 +0,0 @@ -#Thu Jun 24 20:11:26 CEST 2010 -attrDuplicate=2 -attrInvalidName=2 -attrInvalidValue=2 -attrNameMismatch=2 -attrUndefName=2 -attrUndefValue=2 -attrValueMismatch=1 -attrValueUnclosed=2 -cdataInvalidContent=2 -cdataUnclosed=1 -commentInvalidContent=2 -commentUnclosed=1 -docDoctypeUnclosed=1 -docDuplicateTag=1 -docInvalidChar=2 -docInvalidContent=2 -eclipse.preferences.version=1 -elemCoexistence=2 -elemDuplicate=2 -elemEndInvalidCase=1 -elemInvalidContent=2 -elemInvalidDirective=1 -elemInvalidEmptyTag=2 -elemInvalidName=1 -elemMissingEnd=2 -elemMissingStart=1 -elemStartInvalidCase=2 -elemUnclosedEndTag=1 -elemUnclosedStartTag=1 -elemUnknownName=2 -elemUnnecessaryEnd=2 -piInvalidContent=2 -piUnclosed=1 -piUndefined=2 -refInvalidContent=2 diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.container b/.settings/org.eclipse.wst.jsdt.ui.superType.container deleted file mode 100644 index 3bd5d0a4803..00000000000 --- a/.settings/org.eclipse.wst.jsdt.ui.superType.container +++ /dev/null @@ -1 +0,0 @@ -org.eclipse.wst.jsdt.launching.baseBrowserLibrary \ No newline at end of file diff --git a/.settings/org.eclipse.wst.jsdt.ui.superType.name b/.settings/org.eclipse.wst.jsdt.ui.superType.name deleted file mode 100644 index 05bd71b6ec2..00000000000 --- a/.settings/org.eclipse.wst.jsdt.ui.superType.name +++ /dev/null @@ -1 +0,0 @@ -Window \ No newline at end of file diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs deleted file mode 100644 index 00d3fa93bb2..00000000000 --- a/.settings/org.eclipse.wst.validation.prefs +++ /dev/null @@ -1,12 +0,0 @@ -#Sun Feb 20 12:20:29 CET 2011 -DELEGATES_PREFERENCE=delegateValidatorList -USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator; -USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.wst.wsi.ui.internal.WSIMessageValidator; -USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationfalseversion1.2.104.v200911120201 -eclipse.preferences.version=1 -override=true -suspend=false -vals/org.eclipse.php.ui.HTMLValidatorForPHP/groups=0107include01111contentType130org.eclipse.php.core.phpsourceT0107exclude11504file111menu.js.phpF0104file114htdocs/custom2F0204file124htdocs/includes/efc_xfssF0204file125htdocs/includes/adodbtimeF0204file124htdocs/includes/artichowF0204file124htdocs/includes/ckeditorF0204file125htdocs/includes/fckeditorF0204file120htdocs/includes/fpdfF0204file125htdocs/includes/magpierssF0204file122htdocs/includes/nusoapF0204file122htdocs/includes/odtphpF0204file131htdocs/includes/php_excelreaderF0204file130htdocs/includes/php_writeexcelF0204file122htdocs/includes/smartyF0204file121htdocs/includes/tcpdfF02 -vals/org.eclipse.wst.html.ui.HTMLValidator/groups=0107include06111contentType136org.eclipse.wst.html.core.htmlsourceT07fileext04htmlF07fileext05xhtmlF07fileext03htmF07fileext04htplF07fileext03wmlF0107exclude11004file114htdocs/custom2F0204file08dev/specF0204file134htdocs/cashdesk/include/jscalendarF0204file124htdocs/includes/ckeditorF0204file122htdocs/includes/jqueryF0204file123htdocs/includes/jsganttF0204file125htdocs/includes/fckeditorF0204file121htdocs/includes/tcpdfF0204file120htdocs/includes/fpdfF0204file121htdocs/includes/jcropF02 -vals/org.eclipse.wst.xml.core.xml/groups=0107include05111contentType128org.eclipse.core.runtime.xmlT111contentType134org.eclipse.wst.xml.core.xmlsourceT111contentType134org.eclipse.wst.xml.core.xslsourceT111contentType134org.eclipse.jst.jsp.core.tldsourceT07fileext03xmlF0107exclude09113projectNature134org.eclipse.jst.j2ee.ejb.EJBNature113projectNature130org.eclipse.jst.j2ee.EARNature04file08.projectT0104file110.classpathT0104file110.settings/T0204file125htdocs/includes/fckeditorF0204file123htdocs/includes/jsganttF0204file09build/padF0204file117dev/phpcheckstyleF02 -vf.version=3 diff --git a/.settings/org.eclipse.wst.ws.service.policy.prefs b/.settings/org.eclipse.wst.ws.service.policy.prefs deleted file mode 100644 index 1c01941eb2d..00000000000 --- a/.settings/org.eclipse.wst.ws.service.policy.prefs +++ /dev/null @@ -1,3 +0,0 @@ -#Fri May 28 19:41:14 CEST 2010 -eclipse.preferences.version=1 -org.eclipse.wst.ws.service.policy.projectEnabled=false diff --git a/.settings/org.eclipse.wst.xsl.core.prefs b/.settings/org.eclipse.wst.xsl.core.prefs deleted file mode 100644 index 02c732fd908..00000000000 --- a/.settings/org.eclipse.wst.xsl.core.prefs +++ /dev/null @@ -1,13 +0,0 @@ -#Tue Dec 22 11:07:44 CET 2009 -CHECK_CALL_TEMPLATES=2 -CHECK_XPATHS=2 -CIRCULAR_REF=2 -DUPLICATE_PARAMETER=2 -EMPTY_PARAM=1 -MISSING_INCLUDE=2 -MISSING_PARAM=1 -NAME_ATTRIBUTE_EMPTY=2 -NAME_ATTRIBUTE_MISSING=2 -TEMPLATE_CONFLICT=2 -eclipse.preferences.version=1 -use-project-settings=true diff --git a/.settings/org.sonar.ide.eclipse.prefs b/.settings/org.sonar.ide.eclipse.prefs deleted file mode 100644 index 99e5c726c17..00000000000 --- a/.settings/org.sonar.ide.eclipse.prefs +++ /dev/null @@ -1,5 +0,0 @@ -#Thu Jun 03 22:22:09 CEST 2010 -eclipse.preferences.version=1 -projectArtifactId=dolibarr -projectGroupId= -sonarServerUrl=http\://localhost\:9450 From 068c5a98d2aef5a08afa2a986285a5e8dc1c3d84 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Sep 2011 12:52:30 +0200 Subject: [PATCH 3/8] problem synchro git<->cvs !!! --- htdocs/admin/fournisseur.php | 2 +- htdocs/admin/perms.php | 3 +- htdocs/core/class/conf.class.php | 2 +- htdocs/theme/cameleo/style.css.php | 10 +++-- htdocs/user/class/user.class.php | 9 +++-- htdocs/user/fiche.php | 29 +++++++++++--- htdocs/user/group/fiche.php | 12 ++++-- htdocs/user/group/perms.php | 23 ++++++++++- htdocs/user/index.php | 2 +- scripts/emailings/mailing-send.php | 19 +++++++-- ...ail_unpaid_invoices_to_representatives.php | 40 ++++++++++++------- 11 files changed, 111 insertions(+), 40 deletions(-) diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php index 1a858ba6947..9d3da300fa9 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/fournisseur.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 91a8f7e44cc..d0a354cdb40 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2011 Herve Prot * * 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 @@ -141,7 +142,7 @@ $db->commit(); $sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" -$sql.= " AND entity = ".$conf->entity; +$sql.= " AND entity in (".(!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)?"1,":"").$conf->entity.")"; if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable $sql.= " ORDER BY r.module, r.id"; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 648666917b5..4a9da4970a8 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -104,7 +104,7 @@ class Conf $sql = "SELECT ".$db->decrypt('name')." as name,"; $sql.= " ".$db->decrypt('value')." as value, entity"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE entity IN (0,".$this->entity.")"; + $sql.= " WHERE entity IN (0,1,".$this->entity.")"; // 1 to herite configuration $sql.= " ORDER BY entity"; // This is to have entity 0 first, then entity 1 that overwrite. $result = $db->query($sql); diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 2905a700cb0..4e623ca7e3a 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -88,6 +88,10 @@ body { a:link, a:visited, a:active { font-family: ; font-weight: bold; color: blue; text-decoration: none; } a:hover { font-family: ; font-weight: bold; color: #A51B00; text-decoration: none; } +input:focus, textarea:focus, button:focus, select:focus { + box-shadow: 0 0 4px #8091BF; +} + input { font-size: px; font-family: ; @@ -1354,8 +1358,8 @@ tr.liste_titre { th.liste_titre, td.liste_titre { padding-left: 6px; - padding-right: 6px; - /*vertical-align: text-top;*/ + padding-right: 6px; + /*vertical-align: text-top;*/ } th.liste_titre_sel, td.liste_titre_sel { @@ -2143,4 +2147,4 @@ a.cke_dialog_ui_button close(); -?> \ No newline at end of file +?> diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e4aa3962323..5ebcef96a15 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -504,7 +504,7 @@ class User extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."user_rights as ur"; $sql.= ", ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.id = ur.fk_id"; - $sql.= " AND r.entity = ".$conf->entity; + $sql.= " AND r.entity in (0,".(!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)?"1,":"").$conf->entity.")"; $sql.= " AND ur.fk_user= ".$this->id; $sql.= " AND r.perms IS NOT NULL"; if ($moduletag) $sql.= " AND r.module = '".$this->db->escape($moduletag)."'"; @@ -1992,7 +1992,7 @@ class User extends CommonObject * @param string $limitTo Limit to 'active' or 'superadmin' users * @return int Number of users */ - function getNbOfUsers($limitTo='') + function getNbOfUsers($limitTo='',$all=0) { global $conf; @@ -2004,8 +2004,9 @@ class User extends CommonObject } else { - $sql.= " WHERE entity = ".$conf->entity; - if ($limitTo == 'active') $sql.= " AND statut = 1"; + if ($all) $sql.= " WHERE entity = is not null"; + else $sql.= " WHERE entity = ".$conf->entity; + if ($limitTo == 'active') $sql.= " AND statut = 1"; } $resql=$this->db->query($sql); diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 06fc2ff0d98..622b411a840 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -124,7 +124,7 @@ if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) if (!empty($conf->file->main_limit_users)) { - $nb = $edituser->getNbOfUsers("active"); + $nb = $edituser->getNbOfUsers("active",1); if ($nb >= $conf->file->main_limit_users) { $message='
'.$langs->trans("YourQuotaOfUsersIsReached").'
'; @@ -177,7 +177,7 @@ if ($_POST["action"] == 'add' && $canadduser) if (!empty($conf->file->main_limit_users)) // If option to limit users is set { - $nb = $edituser->getNbOfUsers("active"); + $nb = $edituser->getNbOfUsers("active",1); if ($nb >= $conf->file->main_limit_users) { $message='
'.$langs->trans("YourQuotaOfUsersIsReached").'
'; @@ -202,7 +202,15 @@ if ($_POST["action"] == 'add' && $canadduser) $edituser->note = $_POST["note"]; $edituser->ldap_sid = $_POST["ldap_sid"]; // If multicompany is off, admin users must all be on entity 0. - $edituser->entity = (! empty($_POST["admin"]) && (! empty($_POST["superadmin"]) || empty($_POST["entity"]) || empty($conf->multicompany->enabled)) ? 0 : $_POST["entity"]); + if($conf->multicompany->enabled) + if($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ! empty($_POST["superadmin"])) + $edituser->entity=0; + else + $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + else if(! empty($_POST["admin"])) + $edituser->entity=0; + else + $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); $db->begin(); @@ -298,7 +306,16 @@ if ($action == 'update' && ! $_POST["cancel"]) $edituser->webcal_login = $_POST["webcal_login"]; $edituser->phenix_login = $_POST["phenix_login"]; $edituser->phenix_pass = $_POST["phenix_pass"]; - $edituser->entity = ((! empty($_POST["superadmin"]) && ! empty($_POST["admin"]) || empty($_POST["entity"])) ? 0 : $_POST["entity"]); + if($conf->multicompany->enabled) + if($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ! empty($_POST["superadmin"])) + $edituser->entity=0; + else + $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + else if(! empty($_POST["admin"])) + $edituser->entity=0; + else + $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + if (GETPOST('deletephoto')) $edituser->photo=''; if (! empty($_FILES['photo']['name'])) $edituser->photo = dol_sanitizeFileName($_FILES['photo']['name']); @@ -1324,7 +1341,7 @@ else print ''; print ''; print ''; - if(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + if(! empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) { print ''; } @@ -1349,7 +1366,7 @@ else print img_object($langs->trans("ShowGroup"),"group").' '.$group->nom; } print ''; - if(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + if(! empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) { $mc = new ActionsMulticompany($db); $mc->getInfo($group->usergroup_entity); diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php index 25bbdb2b788..67b36fd54df 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -94,7 +94,10 @@ if ($action == 'add') if (! $message) { $object->nom = trim($_POST["nom"]); - $object->entity = $_POST["entity"]; + if($conf->multicompany->enabled && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + $object->entity = 0; + else + $object->entity = $_POST["entity"]; $object->note = trim($_POST["note"]); $db->begin(); @@ -170,7 +173,10 @@ if ($action == 'update') $object->oldcopy=dol_clone($object); $object->nom = trim($_POST["group"]); - $object->entity = $_POST["entity"]; + if($conf->multicompany->enabled && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + $object->entity = 0; + else + $object->entity = $_POST["entity"]; $object->note = dol_htmlcleanlastbr($_POST["note"]); $ret=$object->update(); @@ -301,7 +307,7 @@ else print '\n"; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index f1034254783..8281285b452 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -169,7 +169,16 @@ if ($id) $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= ", ".MAIN_DB_PREFIX."usergroup_rights as ugr"; $sql.= " WHERE ugr.fk_id = r.id"; - $sql.= " AND r.entity = ".(empty($conf->multicompany->enabled) ? $conf->entity : $fgroup->entity); + if(!empty($conf->multicompany->enabled)) + { + if(empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + $sql.= " AND r.entity = ".$conf->entity; + else + $sql.= " AND r.entity in (0,1)"; + } + else + $sql.= " AND r.entity = ".$fgroup->entity; + $sql.= " AND ugr.fk_usergroup = ".$fgroup->id; $result=$db->query($sql); @@ -234,7 +243,17 @@ if ($id) $sql = "SELECT r.id, r.libelle, r.module"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" - $sql.= " AND r.entity = ".(empty($conf->multicompany->enabled) ? $conf->entity : $fgroup->entity); + //$sql.= " AND r.entity = ".(empty($conf->multicompany->enabled) ? $conf->entity : $fgroup->entity); + if(!empty($conf->multicompany->enabled)) + { + if(empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + $sql.= " AND r.entity = ".$conf->entity; + else + $sql.= " AND r.entity in (0,1)"; + } + else + $sql.= " AND r.entity = ".$fgroup->entity; + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable $sql.= " ORDER BY r.module, r.id"; diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 7b985d2252e..13637d30ba7 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -130,7 +130,7 @@ if ($result) } else if (! empty($conf->multicompany->enabled)) { - if ($obj->admin && ! $obj->entity) + if (! $obj->entity) { print $langs->trans("AllEntities"); } diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index e675c743c3f..1d9276d17b0 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -2,7 +2,7 @@ - * Copyright (C) 2005-2010 Laurent Destailleur + * Copyright (C) 2005-2011 Laurent Destailleur * * 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 @@ -151,9 +151,20 @@ if ($resql) $substitutionisok=true; // Fabrication du mail - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, - array(), array(), array(), - '', '', 0, $msgishtml, $errorsto); + $mail = new CMailFile( + $newsubject, + $sendto, + $from, + $newmessage, + array(), + array(), + array(), + '', + '', + 0, + $msgishtml, + $errorsto + ); if ($mail->error) { diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index abe50d71cb2..261296aa806 100644 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -109,7 +109,14 @@ else dol_syslog("email_unpaid_invoices_to_representatives.php: Error"); } - +/** + * Send email + * + * @param string $oldemail Old email + * @param string $message Message to send + * @param string $total Total amount of unpayed invoices + * @return int <0 if KO, >0 if OK + */ function envoi_mail($oldemail,$message,$total) { global $conf,$langs; @@ -129,26 +136,31 @@ function envoi_mail($oldemail,$message,$total) $allmessage .= "\n"; $allmessage .= $langs->trans("Total")." = ".price($total)."\n"; - $mail = new CMailFile($subject, - $sendto, - $from, - $allmessage, - array(), - array(), - array(), - '', - '', - 0, - $msgishtml); + $mail = new CMailFile( + $subject, + $sendto, + $from, + $allmessage, + array(), + array(), + array(), + '', + '', + 0, + $msgishtml + ); $mail->errors_to = $errorsto; $result=$mail->sendfile(); if ($result) { - + return 1; + } + else + { + return -1; } - } From 114ed37a287269ac7fe1c68ee32e0b3a5bacf8e8 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Sep 2011 18:52:30 +0800 Subject: [PATCH 4/8] problem synchro git<->cvs !!! --- htdocs/admin/fournisseur.php | 2 +- htdocs/admin/perms.php | 3 +- htdocs/core/class/conf.class.php | 2 +- htdocs/theme/cameleo/style.css.php | 10 +++-- htdocs/user/class/user.class.php | 9 +++-- htdocs/user/fiche.php | 29 +++++++++++--- htdocs/user/group/fiche.php | 12 ++++-- htdocs/user/group/perms.php | 23 ++++++++++- htdocs/user/index.php | 2 +- scripts/emailings/mailing-send.php | 19 +++++++-- ...ail_unpaid_invoices_to_representatives.php | 40 ++++++++++++------- 11 files changed, 111 insertions(+), 40 deletions(-) diff --git a/htdocs/admin/fournisseur.php b/htdocs/admin/fournisseur.php index 1a858ba6947..9d3da300fa9 100644 --- a/htdocs/admin/fournisseur.php +++ b/htdocs/admin/fournisseur.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2011 Laurent Destailleur * Copyright (C) 2005-2011 Regis Houssin * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier diff --git a/htdocs/admin/perms.php b/htdocs/admin/perms.php index 91a8f7e44cc..d0a354cdb40 100644 --- a/htdocs/admin/perms.php +++ b/htdocs/admin/perms.php @@ -2,6 +2,7 @@ /* Copyright (C) 2003 Rodolphe Quiedeville * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2010 Regis Houssin + * Copyright (C) 2011 Herve Prot * * 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 @@ -141,7 +142,7 @@ $db->commit(); $sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" -$sql.= " AND entity = ".$conf->entity; +$sql.= " AND entity in (".(!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)?"1,":"").$conf->entity.")"; if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable $sql.= " ORDER BY r.module, r.id"; diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 648666917b5..4a9da4970a8 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -104,7 +104,7 @@ class Conf $sql = "SELECT ".$db->decrypt('name')." as name,"; $sql.= " ".$db->decrypt('value')." as value, entity"; $sql.= " FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE entity IN (0,".$this->entity.")"; + $sql.= " WHERE entity IN (0,1,".$this->entity.")"; // 1 to herite configuration $sql.= " ORDER BY entity"; // This is to have entity 0 first, then entity 1 that overwrite. $result = $db->query($sql); diff --git a/htdocs/theme/cameleo/style.css.php b/htdocs/theme/cameleo/style.css.php index 2905a700cb0..4e623ca7e3a 100644 --- a/htdocs/theme/cameleo/style.css.php +++ b/htdocs/theme/cameleo/style.css.php @@ -88,6 +88,10 @@ body { a:link, a:visited, a:active { font-family: ; font-weight: bold; color: blue; text-decoration: none; } a:hover { font-family: ; font-weight: bold; color: #A51B00; text-decoration: none; } +input:focus, textarea:focus, button:focus, select:focus { + box-shadow: 0 0 4px #8091BF; +} + input { font-size: px; font-family: ; @@ -1354,8 +1358,8 @@ tr.liste_titre { th.liste_titre, td.liste_titre { padding-left: 6px; - padding-right: 6px; - /*vertical-align: text-top;*/ + padding-right: 6px; + /*vertical-align: text-top;*/ } th.liste_titre_sel, td.liste_titre_sel { @@ -2143,4 +2147,4 @@ a.cke_dialog_ui_button close(); -?> \ No newline at end of file +?> diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index e4aa3962323..5ebcef96a15 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -504,7 +504,7 @@ class User extends CommonObject $sql.= " FROM ".MAIN_DB_PREFIX."user_rights as ur"; $sql.= ", ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.id = ur.fk_id"; - $sql.= " AND r.entity = ".$conf->entity; + $sql.= " AND r.entity in (0,".(!empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)?"1,":"").$conf->entity.")"; $sql.= " AND ur.fk_user= ".$this->id; $sql.= " AND r.perms IS NOT NULL"; if ($moduletag) $sql.= " AND r.module = '".$this->db->escape($moduletag)."'"; @@ -1992,7 +1992,7 @@ class User extends CommonObject * @param string $limitTo Limit to 'active' or 'superadmin' users * @return int Number of users */ - function getNbOfUsers($limitTo='') + function getNbOfUsers($limitTo='',$all=0) { global $conf; @@ -2004,8 +2004,9 @@ class User extends CommonObject } else { - $sql.= " WHERE entity = ".$conf->entity; - if ($limitTo == 'active') $sql.= " AND statut = 1"; + if ($all) $sql.= " WHERE entity = is not null"; + else $sql.= " WHERE entity = ".$conf->entity; + if ($limitTo == 'active') $sql.= " AND statut = 1"; } $resql=$this->db->query($sql); diff --git a/htdocs/user/fiche.php b/htdocs/user/fiche.php index 06fc2ff0d98..622b411a840 100644 --- a/htdocs/user/fiche.php +++ b/htdocs/user/fiche.php @@ -124,7 +124,7 @@ if ($action == 'confirm_enable' && $confirm == "yes" && $candisableuser) if (!empty($conf->file->main_limit_users)) { - $nb = $edituser->getNbOfUsers("active"); + $nb = $edituser->getNbOfUsers("active",1); if ($nb >= $conf->file->main_limit_users) { $message='
'.$langs->trans("YourQuotaOfUsersIsReached").'
'; @@ -177,7 +177,7 @@ if ($_POST["action"] == 'add' && $canadduser) if (!empty($conf->file->main_limit_users)) // If option to limit users is set { - $nb = $edituser->getNbOfUsers("active"); + $nb = $edituser->getNbOfUsers("active",1); if ($nb >= $conf->file->main_limit_users) { $message='
'.$langs->trans("YourQuotaOfUsersIsReached").'
'; @@ -202,7 +202,15 @@ if ($_POST["action"] == 'add' && $canadduser) $edituser->note = $_POST["note"]; $edituser->ldap_sid = $_POST["ldap_sid"]; // If multicompany is off, admin users must all be on entity 0. - $edituser->entity = (! empty($_POST["admin"]) && (! empty($_POST["superadmin"]) || empty($_POST["entity"]) || empty($conf->multicompany->enabled)) ? 0 : $_POST["entity"]); + if($conf->multicompany->enabled) + if($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ! empty($_POST["superadmin"])) + $edituser->entity=0; + else + $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + else if(! empty($_POST["admin"])) + $edituser->entity=0; + else + $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); $db->begin(); @@ -298,7 +306,16 @@ if ($action == 'update' && ! $_POST["cancel"]) $edituser->webcal_login = $_POST["webcal_login"]; $edituser->phenix_login = $_POST["phenix_login"]; $edituser->phenix_pass = $_POST["phenix_pass"]; - $edituser->entity = ((! empty($_POST["superadmin"]) && ! empty($_POST["admin"]) || empty($_POST["entity"])) ? 0 : $_POST["entity"]); + if($conf->multicompany->enabled) + if($conf->global->MULTICOMPANY_TRANSVERSE_MODE || ! empty($_POST["superadmin"])) + $edituser->entity=0; + else + $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + else if(! empty($_POST["admin"])) + $edituser->entity=0; + else + $edituser->entity = (empty($_POST["entity"]) ? 0 : $_POST["entity"]); + if (GETPOST('deletephoto')) $edituser->photo=''; if (! empty($_FILES['photo']['name'])) $edituser->photo = dol_sanitizeFileName($_FILES['photo']['name']); @@ -1324,7 +1341,7 @@ else print '
'.$langs->trans("Groups").''.$langs->trans("Entity").''.$object->nom; if (empty($object->entity)) { - print img_redstar($langs->trans("GlobalGroup")); + print img_picto($langs->trans("GlobalGroup"),'redstar'); } print "
'; print ''; print ''; - if(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + if(! empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) { print ''; } @@ -1349,7 +1366,7 @@ else print img_object($langs->trans("ShowGroup"),"group").' '.$group->nom; } print ''; - if(! empty($conf->multicompany->enabled) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) + if(! empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1 && $user->admin && ! $user->entity) { $mc = new ActionsMulticompany($db); $mc->getInfo($group->usergroup_entity); diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php index 25bbdb2b788..67b36fd54df 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -94,7 +94,10 @@ if ($action == 'add') if (! $message) { $object->nom = trim($_POST["nom"]); - $object->entity = $_POST["entity"]; + if($conf->multicompany->enabled && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + $object->entity = 0; + else + $object->entity = $_POST["entity"]; $object->note = trim($_POST["note"]); $db->begin(); @@ -170,7 +173,10 @@ if ($action == 'update') $object->oldcopy=dol_clone($object); $object->nom = trim($_POST["group"]); - $object->entity = $_POST["entity"]; + if($conf->multicompany->enabled && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + $object->entity = 0; + else + $object->entity = $_POST["entity"]; $object->note = dol_htmlcleanlastbr($_POST["note"]); $ret=$object->update(); @@ -301,7 +307,7 @@ else print '\n"; diff --git a/htdocs/user/group/perms.php b/htdocs/user/group/perms.php index f1034254783..8281285b452 100644 --- a/htdocs/user/group/perms.php +++ b/htdocs/user/group/perms.php @@ -169,7 +169,16 @@ if ($id) $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= ", ".MAIN_DB_PREFIX."usergroup_rights as ugr"; $sql.= " WHERE ugr.fk_id = r.id"; - $sql.= " AND r.entity = ".(empty($conf->multicompany->enabled) ? $conf->entity : $fgroup->entity); + if(!empty($conf->multicompany->enabled)) + { + if(empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + $sql.= " AND r.entity = ".$conf->entity; + else + $sql.= " AND r.entity in (0,1)"; + } + else + $sql.= " AND r.entity = ".$fgroup->entity; + $sql.= " AND ugr.fk_usergroup = ".$fgroup->id; $result=$db->query($sql); @@ -234,7 +243,17 @@ if ($id) $sql = "SELECT r.id, r.libelle, r.module"; $sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r"; $sql.= " WHERE r.libelle NOT LIKE 'tou%'"; // On ignore droits "tous" - $sql.= " AND r.entity = ".(empty($conf->multicompany->enabled) ? $conf->entity : $fgroup->entity); + //$sql.= " AND r.entity = ".(empty($conf->multicompany->enabled) ? $conf->entity : $fgroup->entity); + if(!empty($conf->multicompany->enabled)) + { + if(empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) + $sql.= " AND r.entity = ".$conf->entity; + else + $sql.= " AND r.entity in (0,1)"; + } + else + $sql.= " AND r.entity = ".$fgroup->entity; + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) $sql.= " AND r.perms NOT LIKE '%_advance'"; // Hide advanced perms if option is disable $sql.= " ORDER BY r.module, r.id"; diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 7b985d2252e..13637d30ba7 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -130,7 +130,7 @@ if ($result) } else if (! empty($conf->multicompany->enabled)) { - if ($obj->admin && ! $obj->entity) + if (! $obj->entity) { print $langs->trans("AllEntities"); } diff --git a/scripts/emailings/mailing-send.php b/scripts/emailings/mailing-send.php index e675c743c3f..1d9276d17b0 100644 --- a/scripts/emailings/mailing-send.php +++ b/scripts/emailings/mailing-send.php @@ -2,7 +2,7 @@ - * Copyright (C) 2005-2010 Laurent Destailleur + * Copyright (C) 2005-2011 Laurent Destailleur * * 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 @@ -151,9 +151,20 @@ if ($resql) $substitutionisok=true; // Fabrication du mail - $mail = new CMailFile($newsubject, $sendto, $from, $newmessage, - array(), array(), array(), - '', '', 0, $msgishtml, $errorsto); + $mail = new CMailFile( + $newsubject, + $sendto, + $from, + $newmessage, + array(), + array(), + array(), + '', + '', + 0, + $msgishtml, + $errorsto + ); if ($mail->error) { diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index abe50d71cb2..261296aa806 100644 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -109,7 +109,14 @@ else dol_syslog("email_unpaid_invoices_to_representatives.php: Error"); } - +/** + * Send email + * + * @param string $oldemail Old email + * @param string $message Message to send + * @param string $total Total amount of unpayed invoices + * @return int <0 if KO, >0 if OK + */ function envoi_mail($oldemail,$message,$total) { global $conf,$langs; @@ -129,26 +136,31 @@ function envoi_mail($oldemail,$message,$total) $allmessage .= "\n"; $allmessage .= $langs->trans("Total")." = ".price($total)."\n"; - $mail = new CMailFile($subject, - $sendto, - $from, - $allmessage, - array(), - array(), - array(), - '', - '', - 0, - $msgishtml); + $mail = new CMailFile( + $subject, + $sendto, + $from, + $allmessage, + array(), + array(), + array(), + '', + '', + 0, + $msgishtml + ); $mail->errors_to = $errorsto; $result=$mail->sendfile(); if ($result) { - + return 1; + } + else + { + return -1; } - } From 3ca702ad27c998f976d087d37499536d86cd3bdb Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Sep 2011 17:49:27 +0200 Subject: [PATCH 5/8] Fix: remove a very old file ! --- mysql/tables/llx_train.sql | 22 ---------------------- 1 file changed, 22 deletions(-) delete mode 100644 mysql/tables/llx_train.sql diff --git a/mysql/tables/llx_train.sql b/mysql/tables/llx_train.sql deleted file mode 100644 index 26ace81486e..00000000000 --- a/mysql/tables/llx_train.sql +++ /dev/null @@ -1,22 +0,0 @@ --- =================================================================== --- $Id$ --- $Source$ --- =================================================================== - - -create table llx_voyage -( - rowid integer AUTO_INCREMENT PRIMARY KEY, - datec datetime, - datev date, -- date de valeur - dateo date, -- date operation - amount real NOT NULL default 0, - label varchar(255), - author varchar(50), - fk_type smallint, -- CB, Virement, cheque - fk_account integer, - num_releve varchar(50), - num_chq int, - rappro tinyint default 0, - note text -); From 2df905e444132824055bc2d66ff79ecd5e06c6c1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 22 Sep 2011 17:59:33 +0200 Subject: [PATCH 6/8] add gitmodules --- .gitmodules | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 00000000000..5627b9e58ac --- /dev/null +++ b/.gitmodules @@ -0,0 +1,48 @@ +[submodule "htdocs/custom/productdiscount"] + path = htdocs/custom/productdiscount + url = git+ssh://hregis@scm.doliforge.org/gitroot/productdiscount/productdiscount.git +[submodule "htdocs/custom/multicompany"] + path = htdocs/custom/multicompany + url = git+ssh://hregis@scm.doliforge.org/gitroot/multicompany/multicompany.git +[submodule "htdocs/custom/paypalplus"] + path = htdocs/custom/paypalplus + url = git+ssh://hregis@scm.doliforge.org/gitroot/paypalplus/paypalplus.git +[submodule "htdocs/custom/milestone"] + path = htdocs/custom/milestone + url = git+ssh://hregis@scm.doliforge.org/gitroot/milestone/milestone.git +[submodule "htdocs/custom/dropbox"] + path = htdocs/custom/dropbox + url = git+ssh://hregis@scm.doliforge.org/gitroot/dropbox/dropbox.git +[submodule "htdocs/custom/docgen"] + path = htdocs/custom/docgen + url = git+ssh://hregis@scm.doliforge.org/gitroot/docgen/docgen.git +[submodule "htdocs/custom/extrafields"] + path = htdocs/custom/extrafields + url = git+ssh://hregis@scm.doliforge.org/gitroot/extrafields/extrafields.git +[submodule "htdocs/custom/business"] + path = htdocs/custom/business + url = git+ssh://hregis@scm.doliforge.org/gitroot/business/business.git +[submodule "htdocs/custom/agefodd"] + path = htdocs/custom/agefodd + url = git+ssh://hregis@scm.doliforge.org/gitroot/agefodd/agefodd.git +[submodule "htdocs/custom/genfac"] + path = htdocs/custom/genfac + url = git+ssh://hregis@scm.doliforge.org/gitroot/massfacturation/massfacturation.git +[submodule "htdocs/custom/lead"] + path = htdocs/custom/lead + url = git+ssh://hregis@scm.doliforge.org/gitroot/lead/lead.git +[submodule "htdocs/custom/team"] + path = htdocs/custom/team + url = git+ssh://hregis@scm.doliforge.org/gitroot/team/team.git +[submodule "htdocs/custom/highcharts"] + path = htdocs/custom/highcharts + url = git+ssh://hregis@scm.doliforge.org/gitroot/highcharts/highcharts.git +[submodule "htdocs/custom/joomla"] + path = htdocs/custom/joomla + url = git+ssh://hregis@scm.doliforge.org/gitroot/joomla/joomla.git +[submodule "htdocs/custom/donation"] + path = htdocs/custom/donation + url = git+ssh://hregis@scm.doliforge.org/gitroot/capnetworks/donate.git +[submodule "htdocs/custom/fidppi"] + path = htdocs/custom/fidppi + url = git+ssh://hregis@doliforge.org/gitroot/fidppi/fidppi.git From 3a35ef50f5b133ca23ed90b3b210c75373239cea Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 24 Sep 2011 17:54:34 +0200 Subject: [PATCH 7/8] Fix: broken canvas --- .../actions_contactcard_common.class.php | 172 ++++++++----- .../actions_contactcard_default.class.php | 51 ++-- htdocs/contact/fiche.php | 88 ++----- htdocs/core/class/canvas.class.php | 155 ++++------- htdocs/includes/modules/modBanque.class.php | 14 +- .../canvas/actions_card_common.class.php | 242 +++++++++--------- .../company/actions_card_company.class.php | 43 ++-- .../actions_card_individual.class.php | 41 +-- .../dao_thirdparty_individual.class.php | 4 +- htdocs/societe/class/societe.class.php | 82 +++--- htdocs/societe/soc.php | 147 ++++------- 11 files changed, 490 insertions(+), 549 deletions(-) diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index a2e0f7e33cf..9e8d17fa718 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -28,12 +28,11 @@ abstract class ActionsContactCardCommon { var $db; + var $dirmodule; var $targetmodule; var $canvas; var $card; - //! Numero d'erreur Plage 1280-1535 - var $errno = 0; //! Template container var $tpl = array(); //! Object container @@ -46,19 +45,66 @@ abstract class ActionsContactCardCommon /** * Constructor * - * @param DoliDB $DB Handler acces base de donnees - * @param string $targetmodule Name of directory of module where canvas is stored - * @param string $canvas Name of canvas - * @param streing $card Name of tab (sub-canvas) + * @param DoliDB $DB Handler acces base de donnees + * @param string $dirmodule Name of directory of module + * @param string $targetmodule Name of directory where canvas is stored + * @param string $canvas Name of canvas + * @param string $card Name of tab (sub-canvas) */ - function ActionsContactCardCommon($DB,$targetmodule,$canvas,$card) + function __construct($DB, $dirmodule, $targetmodule, $canvas, $card) { - $this->db = $DB; - $this->targetmodule = $targetmodule; - $this->canvas = $canvas; - $this->card = $card; + $this->db = $DB; + $this->dirmodule = $targetmodule; + $this->targetmodule = $targetmodule; + $this->canvas = $canvas; + $this->card = $card; } - + + /** + * Instantiation of DAO class + * + * @return void + */ + private function getInstanceDao() + { + if (! is_object($this->object)) + { + $modelclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/dao_'.$this->targetmodule.'_'.$this->canvas.'.class.php'); + if (file_exists($modelclassfile)) + { + // Include dataservice class (model) + $ret = require_once($modelclassfile); + if ($ret) + { + // Instantiate dataservice class (model) + $modelclassname = 'Dao'.ucfirst($this->targetmodule).ucfirst($this->canvas); + $this->object = new $modelclassname($this->db); + } + } + } + } + + /** + * Get object + * + * @param int Object id + * @return object Object loaded + */ + function getObject($id) + { + $ret = $this->getInstanceDao(); + + if (is_object($this->object) && method_exists($this->object,'fetch')) + { + if (! empty($id)) $this->object->fetch($id); + } + else + { + $object = new Contact($this->db); + if (! empty($id)) $object->fetch($id); + $this->object = $object; + } + } /** * Load data control @@ -66,12 +112,12 @@ abstract class ActionsContactCardCommon * @param int $id Id of object * @return void */ - function doActions($id) + function doActions(&$action) { global $conf, $user, $langs; // Creation utilisateur depuis contact - if (GETPOST("action") == 'confirm_create_user' && GETPOST("confirm") == 'yes') + if ($action == 'confirm_create_user' && GETPOST("confirm") == 'yes') { // Recuperation contact actuel $result = $this->object->fetch($id); @@ -110,14 +156,14 @@ abstract class ActionsContactCardCommon } // Creation contact - if ($_POST["action"] == 'add') + if ($action == 'add') { $this->assign_post(); if (! $_POST["name"]) { array_push($this->errors,$langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname").' / '.$langs->transnoentities("Label"))); - $_GET["action"] = $_POST["action"] = 'create'; + $action = 'create'; } if ($_POST["name"]) @@ -131,12 +177,12 @@ abstract class ActionsContactCardCommon else { $this->errors=$this->object->errors; - $_GET["action"] = $_POST["action"] = 'create'; + $action = 'create'; } } } - if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes') + if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') { $result=$this->object->fetch($id); @@ -146,7 +192,7 @@ abstract class ActionsContactCardCommon $result = $this->object->delete(); if ($result > 0) { - Header("Location: index.php"); + Header("Location: list.php"); exit; } else @@ -155,12 +201,18 @@ abstract class ActionsContactCardCommon } } - if ($_POST["action"] == 'update' && ! $_POST["cancel"]) + if ($action == 'update') { + if ($_POST["cancel"]) + { + Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$this->object->id); + exit; + } + if (empty($_POST["name"])) { $this->error=array($langs->trans("ErrorFieldRequired",$langs->transnoentities("Name").' / '.$langs->transnoentities("Label"))); - $_GET["action"] = $_POST["action"] = 'edit'; + $action = 'edit'; } if (empty($this->error)) @@ -175,55 +227,36 @@ abstract class ActionsContactCardCommon if ($result > 0) { - $this->object->old_name=''; - $this->object->old_firstname=''; + Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$this->object->id); + exit; } else { $this->errors=$this->object->errors; + $action = 'edit'; } } } } - - /** - * Return the title of card - * - * @param string $action Type of action - * @return string HTML output - */ - function getTitle($action) - { - global $langs; - - $out=''; - - if ($action == 'view' || $action == 'edit') $out.= $langs->trans("ContactsAddresses"); - if ($action == 'create') $out.= $langs->trans("AddContact"); - - return $out; - } - /** * Set content of ->tpl array, to use into template * * @param string $action Type of action * @return string HTML output */ - function assign_values($action='') + function assign_values(&$action) { global $conf, $langs, $user, $canvas; global $form, $formcompany, $objsoc; - if ($action == 'create' || $action == 'edit') $this->assign_post($action); + if ($action == 'add' || $action == 'update') $this->assign_post(); foreach($this->object as $key => $value) { $this->tpl[$key] = $value; } - $this->tpl['title']=$this->getTitle($action); $this->tpl['error']=$this->error; $this->tpl['errors']=$this->errors; @@ -289,7 +322,7 @@ abstract class ActionsContactCardCommon $this->tpl['select_visibility'] = $form->selectarray('priv',$selectarray,$this->object->priv,0); } - if ($action == 'view' || $action == 'edit') + if ($action == 'view' || $action == 'edit' || $action == 'delete') { // Emailing if ($conf->mailing->enabled) @@ -339,29 +372,8 @@ abstract class ActionsContactCardCommon else $this->tpl['dolibarr_user'] = $langs->trans("NoDolibarrAccess"); } - if ($action == 'view') + if ($action == 'view' || $action == 'delete') { - if ($_GET["action"] == 'create_user') - { - // Full firstname and name separated with a dot : firstname.name - include_once(DOL_DOCUMENT_ROOT.'/lib/functions2.lib.php'); - $login=dol_buildlogin($this->object->nom, $this->object->prenom); - - $generated_password=''; - if (! $ldap_sid) - { - $generated_password=getRandomPassword(''); - } - $password=$generated_password; - - // Create a form array - $formquestion=array( - array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login), - array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password)); - - $this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion,'no'); - } - $this->tpl['showrefnav'] = $form->showrefnav($this->object,'id'); if ($this->object->socid > 0) @@ -395,15 +407,35 @@ abstract class ActionsContactCardCommon $this->tpl['note'] = nl2br($this->object->note); } + + if ($action == 'create_user') + { + // Full firstname and name separated with a dot : firstname.name + include_once(DOL_DOCUMENT_ROOT.'/lib/functions2.lib.php'); + $login=dol_buildlogin($this->object->nom, $this->object->prenom); + + $generated_password=''; + if (! $ldap_sid) + { + $generated_password=getRandomPassword(''); + } + $password=$generated_password; + + // Create a form array + $formquestion=array( + array('label' => $langs->trans("LoginToCreate"), 'type' => 'text', 'name' => 'login', 'value' => $login), + array('label' => $langs->trans("Password"), 'type' => 'text', 'name' => 'password', 'value' => $password)); + + $this->tpl['action_create_user'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("CreateDolibarrLogin"),$langs->trans("ConfirmCreateContact"),"confirm_create_user",$formquestion,'no'); + } } /** * Assign POST values into object * - * @param string $action Action string * @return string HTML output */ - private function assign_post($action) + private function assign_post() { global $langs, $mysoc; diff --git a/htdocs/contact/canvas/default/actions_contactcard_default.class.php b/htdocs/contact/canvas/default/actions_contactcard_default.class.php index ae33c4e0d78..4230d8bbe38 100644 --- a/htdocs/contact/canvas/default/actions_contactcard_default.class.php +++ b/htdocs/contact/canvas/default/actions_contactcard_default.class.php @@ -30,26 +30,44 @@ include_once(DOL_DOCUMENT_ROOT.'/contact/canvas/actions_contactcard_common.class class ActionsContactCardDefault extends ActionsContactCardCommon { var $db; + var $dirmodule; var $targetmodule; var $canvas; var $card; /** - * Constructor + * Constructor * - * @param DoliDB $DB Handler acces base de donnees - * @param string $targetmodule Name of directory of module where canvas is stored - * @param string $canvas Name of canvas - * @param string $card Name of tab (sub-canvas) + * @param DoliDB $DB Handler acces base de donnees + * @param string $dirmodule Name of directory of module + * @param string $targetmodule Name of directory of module where canvas is stored + * @param string $canvas Name of canvas + * @param string $card Name of tab (sub-canvas) */ - function ActionsContactCardDefault($DB,$targetmodule,$canvas,$card) + function __construct($DB, $dirmodule, $targetmodule, $canvas, $card) { $this->db = $DB; + $this->dirmodule = $dirmodule; $this->targetmodule = $targetmodule; $this->canvas = $canvas; $this->card = $card; } + + /** + * Return the title of card + */ + private function getTitle($action) + { + global $langs; + $out=''; + + if ($action == 'view') $out.= $langs->trans("Contact"); + if ($action == 'edit') $out.= $langs->trans("EditContact"); + if ($action == 'create') $out.= $langs->trans("NewContact"); + + return $out; + } /** * Assign custom values for canvas @@ -57,10 +75,12 @@ class ActionsContactCardDefault extends ActionsContactCardCommon * @param string $action Type of action * @return void */ - function assign_values($action='') + function assign_values(&$action, $id) { global $conf, $db, $langs, $user; global $form; + + $ret = $this->getObject($id); parent::assign_values($action); @@ -77,15 +97,6 @@ class ActionsContactCardDefault extends ActionsContactCardCommon $this->tpl['showhead']=dol_get_fiche_head($head, 'card', $title, 0, 'contact'); $this->tpl['showend']=dol_get_fiche_end(); - // Confirm delete contact - if ($user->rights->societe->contact->supprimer) - { - if ($_GET["action"] == 'delete') - { - $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); - } - } - $objsoc = new Societe($db); $objsoc->fetch($this->object->fk_soc); @@ -93,6 +104,14 @@ class ActionsContactCardDefault extends ActionsContactCardCommon $this->tpl['actionsdone']=show_actions_done($conf,$langs,$db,$objsoc,$this->object,1); } + else + { + // Confirm delete contact + if ($action == 'delete' && $user->rights->societe->contact->supprimer) + { + $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?id=".$this->object->id,$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); + } + } if ($action == 'list') { diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 7e01644b08d..4f66bbdfc92 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -39,9 +39,10 @@ $langs->load("commercial"); $mesg=''; $error=0; $errors=array(); -$action = GETPOST('action'); -$id = GETPOST("id"); -$socid = GETPOST("socid"); +$action = (GETPOST('action') ? GETPOST('action') : 'view'); +$confirm = GETPOST('confirm'); +$id = GETPOST("id"); +$socid = GETPOST("socid"); if ($user->societe_id) $socid=$user->societe_id; $object = new Contact($db); @@ -52,8 +53,8 @@ $canvas = $object->canvas?$object->canvas:GETPOST("canvas"); if (! empty($canvas)) { require_once(DOL_DOCUMENT_ROOT."/core/class/canvas.class.php"); - $objcanvas = new Canvas($db,$action); - $objcanvas->getCanvas('contact','contactcard',$canvas); + $objcanvas = new Canvas($db, $action); + $objcanvas->getCanvas('contact', 'contactcard', $canvas); } // Security check @@ -69,25 +70,9 @@ $hookmanager->callHooks(array('contactcard')); * Actions */ -$parameters=array('id'=>$id); +$parameters=array('id'=>$id, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks - -// ---------- start deprecated. Use hook to hook actions. -// If canvas actions are defined, because on url, or because contact was created with canvas feature on, we use the canvas feature. -// If canvas actions are not defined, we use standard feature. -if (method_exists($objcanvas->control,'doActions')) -{ - $objcanvas->doActions($id); - if (! empty($objcanvas->error) || (! empty($objcanvas->errors) && count($objcanvas->errors) > 0)) - { - $error=$objcanvas->error; $errors=$objcanvas->errors; - if ($action=='add') { $objcanvas->action='create'; $action='create'; } - if ($action=='update') { $objcanvas->action='edit'; $action='edit'; } - } -} -// ---------- end deprecated. - if (empty($reshook)) { // Cancel @@ -98,7 +83,7 @@ if (empty($reshook)) } // Creation utilisateur depuis contact - if ($_POST["action"] == 'confirm_create_user' && $_POST["confirm"] == 'yes' && $user->rights->user->user->creer) + if ($action == 'confirm_create_user' && $confirm == 'yes' && $user->rights->user->user->creer) { // Recuperation contact actuel $result = $object->fetch($_GET["id"]); @@ -137,7 +122,7 @@ if (empty($reshook)) } // Add contact - if (GETPOST("action") == 'add' && $user->rights->societe->contact->creer) + if ($action == 'add' && $user->rights->societe->contact->creer) { $db->begin(); @@ -196,7 +181,7 @@ if (empty($reshook)) } } - if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes' && $user->rights->societe->contact->supprimer) + if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->societe->contact->supprimer) { $result=$object->fetch($_GET["id"]); @@ -215,12 +200,12 @@ if (empty($reshook)) } } - if ($_POST["action"] == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer) + if ($action == 'update' && ! $_POST["cancel"] && $user->rights->societe->contact->creer) { if (empty($_POST["name"])) { $error++; $errors=array($langs->trans("ErrorFieldRequired",$langs->transnoentities("Name").' / '.$langs->transnoentities("Label"))); - $_GET["action"] = $_POST["action"] = 'edit'; + $action = 'edit'; } if (! count($errors)) @@ -287,41 +272,14 @@ if ($socid > 0) $objsoc->fetch($socid); } -// TODO Mutualize this part of code (same than societe/soc.php and product/fiche.php) -if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) +if (is_object($objcanvas) && $objcanvas->displayCanvasExists()) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- - if ($action == 'create') - { - $objcanvas->assign_values($action); // Set value for templates - $objcanvas->display_canvas($action); // Show template - } - else if ($action == 'edit') - { - $objcanvas->control->object=$objcanvas->getObject($id); // TODO: Getting and storing object should be done into assign_values (for template with no code) or into tpl - if (empty($objcanvas->control->object)) - { - $object = new Contact($db); - $object->fetch($id,$user); - $objcanvas->control->object=$object; - } - $objcanvas->assign_values($action); // Set value for templates - $objcanvas->display_canvas($action); // Show template - } - else - { - $objcanvas->control->object=$objcanvas->getObject($id); // TODO: Getting and storing object should be done into assign_values (for template with no code) or into tpl - if (empty($objcanvas->control->object)) - { - $object = new Contact($db); - $object->fetch($id,$user); - $objcanvas->control->object=$object; - } - $objcanvas->assign_values('view'); // Assign values - $objcanvas->display_canvas('view'); // Show template - } + + $objcanvas->assign_values($action, $id); // Set value for templates + $objcanvas->display_canvas(); // Show template } else { @@ -332,7 +290,7 @@ else // Confirm deleting contact if ($user->rights->societe->contact->supprimer) { - if ($_GET["action"] == 'delete') + if ($action == 'delete') { $ret=$form->form_confirm($_SERVER["PHP_SELF"]."?id=".$_GET["id"],$langs->trans("DeleteContact"),$langs->trans("ConfirmDeleteContact"),"confirm_delete",'',0,1); if ($ret == 'html') print '
'; @@ -342,7 +300,7 @@ else /* * Onglets */ - if (GETPOST("id") > 0) + if ($id > 0) { // Si edition contact deja existant $object = new Contact($db); @@ -350,7 +308,7 @@ else if ($return <= 0) { dol_print_error('',$object->error); - $_GET["id"]=0; + $id=0; } // Show tabs @@ -361,7 +319,7 @@ else if ($user->rights->societe->contact->creer) { - if (GETPOST("action") == 'create') + if ($action == 'create') { /* * Fiche en mode creation @@ -549,7 +507,7 @@ else print ""; } - elseif (GETPOST("action") == 'edit' && GETPOST("id")) + elseif ($action == 'edit' && ! empty($id)) { /* * Fiche en mode edition @@ -734,7 +692,7 @@ else } } - if (GETPOST("id") && GETPOST("action") != 'edit') + if (! empty($id) && $action != 'edit') { $objsoc = new Societe($db); @@ -744,7 +702,7 @@ else dol_htmloutput_errors($error,$errors); - if ($_GET["action"] == 'create_user') + if ($action == 'create_user') { // Full firstname and name separated with a dot : firstname.name include_once(DOL_DOCUMENT_ROOT.'/lib/functions2.lib.php'); diff --git a/htdocs/core/class/canvas.class.php b/htdocs/core/class/canvas.class.php index 032b646d340..e2a9672428a 100644 --- a/htdocs/core/class/canvas.class.php +++ b/htdocs/core/class/canvas.class.php @@ -32,9 +32,10 @@ class Canvas var $db; var $error; var $errors=array(); + + var $actiontype; - var $action; - + var $dirmodule; // Module directory var $targetmodule; // Module concerned by canvas (ex: thirdparty, contact, ...) var $canvas; // Name of canvas var $card; // Tab (sub-canvas) @@ -49,29 +50,17 @@ class Canvas * Constructor * * @param DoliDB $DB Database handler - * @param string $action Action ('create', 'view', 'edit') */ - function Canvas($DB, $action='view') + function __construct($DB, $actiontype='view') { $this->db = $DB; - $this->action = $action; - if ($this->action == 'add') $this->action='create'; - if ($this->action == 'update') $this->action='edit'; - if (empty($this->action)) $this->action='view'; + + $this->actiontype = $actiontype; + if ($this->actiontype == 'add') $this->actiontype='create'; + if ($this->actiontype == 'update') $this->actiontype='edit'; + if (empty($this->actiontype) || $this->actiontype == 'delete' || $this->actiontype == 'create_user') $this->actiontype='view'; } - /** - * Set action type - * - * @deprecated Kept for backward compatibility - */ - function setAction($action='view') - { - return $this->action = $action; - } - - - /** * Initialize properties: ->targetmodule, ->canvas, ->card * and MVC properties: ->control (Controller), ->control->object (Model), ->template_dir (View) @@ -90,17 +79,17 @@ class Canvas $this->targetmodule = $module; $this->canvas = $canvas; $this->card = $card; - $dirmodule = $module; + $this->dirmodule = $module; // Correct values if canvas is into an external module if (preg_match('/^([^@]+)@([^@]+)$/i',$canvas,$regs)) { $this->canvas = $regs[1]; - $dirmodule = $regs[2]; + $this->dirmodule = $regs[2]; } // For compatibility - if ($dirmodule == 'thirdparty') { $dirmodule = 'societe'; } + if ($this->dirmodule == 'thirdparty') { $this->dirmodule = 'societe'; } - $controlclassfile = dol_buildpath('/'.$dirmodule.'/canvas/'.$this->canvas.'/actions_'.$this->card.'_'.$this->canvas.'.class.php'); + $controlclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/actions_'.$this->card.'_'.$this->canvas.'.class.php'); if (file_exists($controlclassfile)) { // Include actions class (controller) @@ -109,23 +98,11 @@ class Canvas // Instantiate actions class (controller) $controlclassname = 'Actions'.ucfirst($this->card).ucfirst($this->canvas); - $this->control = new $controlclassname($this->db,$this->targetmodule,$this->canvas,$this->card); + $this->control = new $controlclassname($this->db, $this->dirmodule, $this->targetmodule, $this->canvas, $this->card); } - // TODO Dao should be declared and used by controller or templates when required only - $modelclassfile = dol_buildpath('/'.$dirmodule.'/canvas/'.$this->canvas.'/dao_'.$this->targetmodule.'_'.$this->canvas.'.class.php'); - if (file_exists($modelclassfile)) - { - // Include dataservice class (model) - require_once($modelclassfile); - - // Instantiate dataservice class (model) - $modelclassname = 'Dao'.ucfirst($this->targetmodule).ucfirst($this->canvas); - $this->control->object = new $modelclassname($this->db); - } - // Template dir - $this->template_dir = dol_buildpath('/'.$dirmodule.'/canvas/'.$this->canvas.'/tpl/'); + $this->template_dir = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/tpl/'); if (! is_dir($this->template_dir)) { $this->template_dir=''; @@ -137,89 +114,61 @@ class Canvas return 1; } - - /** - * Execute actions - * - * @param id Id of object (may be empty for creation) - * @deprecated Use actions with hooks instead - */ - function doActions($id) - { - $out=''; - - // If function to do actions is overwritten, we use new one - if (method_exists($this->control,'doActions')) - { - $out = $this->control->doActions($id,$this->targetmodule,$this->canvas,$this->card); - - $this->errors = ($this->control->errors?$this->control->errors:$this->control->object->errors); - $this->error = ($this->control->error?$this->control->error:$this->control->object->error); - } - - return $out; - } - - /** - * Get object - * - * @param param1 Param1 - * @param param2 Param2 - * @param param3 Param3 - * @return object Object loaded - */ - function getObject($param1, $param2='', $param3='') - { - if (is_object($this->control->object) && method_exists($this->control->object,'fetch')) - { - $this->control->object->fetch($param1, $param2, $param3); - return $this->control->object; - } - else - { - return 0; - } - } - - /** - * Shared method for canvas to assign values for templates + + /** + * Shared method for canvas to execute actions + * + * @param string $action Action string + * @param int $id Object id + * @return void */ - function assign_values($action) + function doActions(&$action='view', $id=0) { - if (method_exists($this->control,'assign_values')) $this->control->assign_values($action); + if (method_exists($this->control,'doActions')) + { + $ret = $this->control->doActions($action, $id); + return $ret; + } } /** - * Return the template to display canvas (if it exists) + * Shared method for canvas to assign values for templates + * + * @param string $action Action string + * @param int $id Object id + * @return void + */ + function assign_values(&$action='view', $id=0) + { + if (method_exists($this->control,'assign_values')) $this->control->assign_values($action, $id); + } + + /** + * Return the template to display canvas (if it exists) * - * @param string $mode 'create', ''='view', 'edit', 'list' - * @return string Path to display canvas file if it exists, '' otherwise. + * @return string Path to display canvas file if it exists, '' otherwise. */ - function displayCanvasExists($mode='view') + function displayCanvasExists() { - $newmode=$mode; - if (empty($newmode)) $newmode='view'; if (empty($this->template_dir)) return 0; - //print $this->template_dir.($this->card?$this->card.'_':'').$newmode.'.tpl.php'; - if (file_exists($this->template_dir.($this->card?$this->card.'_':'').$newmode.'.tpl.php')) return 1; + //print $this->template_dir.($this->card?$this->card.'_':'').$this->actiontype.'.tpl.php'; + if (file_exists($this->template_dir.($this->card?$this->card.'_':'').$this->actiontype.'.tpl.php')) return 1; else return 0; } /** - * Display a canvas page. This will include the template for output. - * Variables used by templates may have been defined, loaded before - * into the assign_values function. + * Display a canvas page. This will include the template for output. + * Variables used by templates may have been defined, loaded before + * into the assign_values function. * - * @param string $mode 'create', 'view', 'edit' - * @param int $id Id of object to show + * @return void */ - function display_canvas($mode='view',$id=0) + function display_canvas() { global $db, $conf, $langs, $user, $canvas; - global $id, $form, $formfile; + global $form, $formfile; - //print $this->template_dir.($this->card?$this->card.'_':'').$mode.'.tpl.php';exit; - include($this->template_dir.($this->card?$this->card.'_':'').$mode.'.tpl.php'); // Include native PHP template + include($this->template_dir.($this->card?$this->card.'_':'').$this->actiontype.'.tpl.php'); // Include native PHP template } } diff --git a/htdocs/includes/modules/modBanque.class.php b/htdocs/includes/modules/modBanque.class.php index e4acc6943d7..d3bdfc89976 100644 --- a/htdocs/includes/modules/modBanque.class.php +++ b/htdocs/includes/modules/modBanque.class.php @@ -3,7 +3,7 @@ * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2008-2009 Regis Houssin + * Copyright (C) 2008-2011 Regis Houssin * * 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 @@ -30,16 +30,18 @@ include_once(DOL_DOCUMENT_ROOT ."/includes/modules/DolibarrModules.class.php"); -/** \class modBanque - \brief Classe de description et activation du module Banque +/** + * \class modBanque + * \brief Classe de description et activation du module Banque */ class modBanque extends DolibarrModules { /** - * \brief Constructeur. Definit les noms, constantes et boites - * \param DB handler d'acc�s base + * Constructor. + * + * @param DoliDB $DB Database handler */ function modBanque($DB) { @@ -166,6 +168,7 @@ class modBanque extends DolibarrModules * Function called when module is enabled. * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. * It also creates data directories. + * * @return int 1 if OK, 0 if KO */ function init() @@ -184,6 +187,7 @@ class modBanque extends DolibarrModules * Function called when module is disabled. * Remove from database constants, boxes and permissions from Dolibarr database. * Data directories are not deleted. + * * @return int 1 if OK, 0 if KO */ function remove() diff --git a/htdocs/societe/canvas/actions_card_common.class.php b/htdocs/societe/canvas/actions_card_common.class.php index 68fd3c1d99f..c8d0591f61e 100644 --- a/htdocs/societe/canvas/actions_card_common.class.php +++ b/htdocs/societe/canvas/actions_card_common.class.php @@ -29,6 +29,7 @@ abstract class ActionsCardCommon { var $db; + var $dirmodule; var $targetmodule; var $canvas; var $card; @@ -45,27 +46,74 @@ abstract class ActionsCardCommon /** * Constructor * - * @param DoliDB $DB Database handler - * @param string $targetmodule Name of directory of module where canvas is stored - * @param string $canvas Name of canvas - * @param string $card Name of tab (sub-canvas) + * @param DoliDB $DB Database handler + * @param string $dirmodule Name of directory of module + * @param string $targetmodule Name of directory where canvas is stored + * @param string $canvas Name of canvas + * @param string $card Name of tab (sub-canvas) */ - function ActionsCardCommon($DB,$targetmodule,$canvas,$card) + function __construct($DB, $dirmodule, $targetmodule, $canvas, $card) { $this->db = $DB; + $this->dirmodule = $dirmodule; $this->targetmodule = $targetmodule; $this->canvas = $canvas; $this->card = $card; } - + + /** + * Instantiation of DAO class + * + * @return void + */ + private function getInstanceDao() + { + if (! is_object($this->object)) + { + $modelclassfile = dol_buildpath('/'.$this->dirmodule.'/canvas/'.$this->canvas.'/dao_'.$this->targetmodule.'_'.$this->canvas.'.class.php'); + if (file_exists($modelclassfile)) + { + // Include dataservice class (model) + $ret = require_once($modelclassfile); + if ($ret) + { + // Instantiate dataservice class (model) + $modelclassname = 'Dao'.ucfirst($this->targetmodule).ucfirst($this->canvas); + $this->object = new $modelclassname($this->db); + } + } + } + } + + /** + * Get object + * + * @param int Object id + * @return object Object loaded + */ + function getObject($id) + { + $ret = $this->getInstanceDao(); + + if (is_object($this->object) && method_exists($this->object,'fetch')) + { + if (! empty($id)) $this->object->fetch($id); + } + else + { + $object = new Societe($this->db); + if (! empty($id)) $object->fetch($id); + $this->object = $object; + } + } /** - * Load data control + * Load data control * - * @param int $socid Id of third party - * @return void + * @param int $socid Id of third party + * @return void */ - function doActions($socid) + function doActions(&$action) { global $conf, $user, $langs; @@ -83,78 +131,68 @@ abstract class ActionsCardCommon // Add new third party if ((! $_POST["getcustomercode"] && ! $_POST["getsuppliercode"]) - && ($_POST["action"] == 'add' || $_POST["action"] == 'update')) + && ($action == 'add' || $action == 'update')) { require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); $error=0; - if ($_POST["action"] == 'update') + if (GETPOST("private") == 1) { - // Load properties of company - $this->object->fetch($socid); - } + $this->object->particulier = GETPOST("private"); - if ($_REQUEST["private"] == 1) - { - $this->object->particulier = $_REQUEST["private"]; - - $this->object->nom = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?trim($_POST["prenom"].' '.$_POST["nom"]):trim($_POST["nom"].' '.$_POST["prenom"]); - $this->object->nom_particulier = $_POST["nom"]; - $this->object->prenom = $_POST["prenom"]; - $this->object->civilite_id = $_POST["civilite_id"]; + $this->object->nom = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?trim($_POST["prenom"].' '.$_POST["nom"]):trim($_POST["nom"].' '.$_POST["prenom"]); + $this->object->nom_particulier = $_POST["nom"]; + $this->object->prenom = $_POST["prenom"]; + $this->object->civilite_id = $_POST["civilite_id"]; } else { - $this->object->nom = $_POST["nom"]; + $this->object->name = $_POST["nom"]; } - $this->object->adresse = $_POST["adresse"]; // TODO deprecated - $this->object->address = $_POST["adresse"]; - $this->object->cp = $_POST["zipcode"]; // TODO deprecated - $this->object->zip = $_POST["zipcode"]; - $this->object->ville = $_POST["town"]; // TODO deprecated - $this->object->town = $_POST["town"]; - $this->object->pays_id = $_POST["pays_id"]; // TODO deprecated - $this->object->country_id = $_POST["pays_id"]; - $this->object->state_id = $_POST["departement_id"]; - $this->object->tel = $_POST["tel"]; - $this->object->fax = $_POST["fax"]; - $this->object->email = trim($_POST["email"]); - $this->object->url = $_POST["url"]; - $this->object->siren = $_POST["idprof1"]; - $this->object->siret = $_POST["idprof2"]; - $this->object->ape = $_POST["idprof3"]; - $this->object->idprof4 = $_POST["idprof4"]; - $this->object->prefix_comm = $_POST["prefix_comm"]; - $this->object->code_client = $_POST["code_client"]; - $this->object->code_fournisseur = $_POST["code_fournisseur"]; - $this->object->capital = $_POST["capital"]; - $this->object->gencod = $_POST["gencod"]; - $this->object->canvas = $_REQUEST["canvas"]; + $this->object->address = $_POST["adresse"]; + $this->object->zip = $_POST["zipcode"]; + $this->object->town = $_POST["town"]; + $this->object->country_id = $_POST["pays_id"]; + $this->object->state_id = $_POST["departement_id"]; + $this->object->tel = $_POST["tel"]; + $this->object->fax = $_POST["fax"]; + $this->object->email = trim($_POST["email"]); + $this->object->url = $_POST["url"]; + $this->object->idprof1 = $_POST["idprof1"]; + $this->object->idprof2 = $_POST["idprof2"]; + $this->object->idprof3 = $_POST["idprof3"]; + $this->object->idprof4 = $_POST["idprof4"]; + $this->object->prefix_comm = $_POST["prefix_comm"]; + $this->object->code_client = $_POST["code_client"]; + $this->object->code_fournisseur = $_POST["code_fournisseur"]; + $this->object->capital = $_POST["capital"]; + $this->object->gencod = $_POST["gencod"]; + $this->object->canvas = GETPOST("canvas"); - $this->object->tva_assuj = $_POST["assujtva_value"]; + $this->object->tva_assuj = $_POST["assujtva_value"]; // Local Taxes - $this->object->localtax1_assuj = $_POST["localtax1assuj_value"]; - $this->object->localtax2_assuj = $_POST["localtax2assuj_value"]; - $this->object->tva_intra = $_POST["tva_intra"]; + $this->object->localtax1_assuj = $_POST["localtax1assuj_value"]; + $this->object->localtax2_assuj = $_POST["localtax2assuj_value"]; + $this->object->tva_intra = $_POST["tva_intra"]; - $this->object->forme_juridique_code = $_POST["forme_juridique_code"]; - $this->object->effectif_id = $_POST["effectif_id"]; - if ($_REQUEST["private"] == 1) + $this->object->forme_juridique_code = $_POST["forme_juridique_code"]; + $this->object->effectif_id = $_POST["effectif_id"]; + if (GETPOST("private") == 1) { - $this->object->typent_id = 8; // TODO predict another method if the field "special" change of rowid + $this->object->typent_id = 8; // TODO predict another method if the field "special" change of rowid } else { - $this->object->typent_id = $_POST["typent_id"]; + $this->object->typent_id = $_POST["typent_id"]; } - $this->object->client = $_POST["client"]; - $this->object->fournisseur = $_POST["fournisseur"]; - $this->object->fournisseur_categorie = $_POST["fournisseur_categorie"]; + $this->object->client = $_POST["client"]; + $this->object->fournisseur = $_POST["fournisseur"]; + $this->object->fournisseur_categorie = $_POST["fournisseur_categorie"]; - $this->object->commercial_id = $_POST["commercial_id"]; - $this->object->default_lang = $_POST["default_lang"]; + $this->object->commercial_id = $_POST["commercial_id"]; + $this->object->default_lang = $_POST["default_lang"]; // Check parameters if (empty($_POST["cancel"])) @@ -164,27 +202,27 @@ abstract class ActionsCardCommon $error = 1; $langs->load("errors"); $this->error = $langs->trans("ErrorBadEMail",$this->object->email); - $_GET["action"] = $_POST["action"]=='add'?'create':'edit'; + $action = ($action == 'add' ? 'create' : 'edit'); } if (! empty($this->object->url) && ! isValidUrl($this->object->url)) { $error = 1; $langs->load("errors"); $this->error = $langs->trans("ErrorBadUrl",$this->object->url); - $_GET["action"] = $_POST["action"]=='add'?'create':'edit'; + $action = ($action == 'add' ? 'create' : 'edit'); } if ($this->object->fournisseur && ! $conf->fournisseur->enabled) { $error = 1; $langs->load("errors"); $this->error = $langs->trans("ErrorSupplierModuleNotEnabled"); - $_GET["action"] = $_POST["action"]=='add'?'create':'edit'; + $action = ($action == 'add' ? 'create' : 'edit'); } } if (! $error) { - if ($_POST["action"] == 'add') + if ($action == 'add') { $this->db->begin(); @@ -248,48 +286,44 @@ abstract class ActionsCardCommon $this->db->rollback(); $this->errors=$this->object->errors; - $_GET["action"]='create'; + $action = 'create'; } } - if ($_POST["action"] == 'update') + if ($action == 'update') { if ($_POST["cancel"]) { - Header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); + Header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$this->object->id); exit; } - - $oldsoccanvas = new Canvas($this->db); - $oldsoccanvas->getCanvas('thirdparty','card',$this->object->canvas); - $result=$oldsoccanvas->control->object->fetch($socid); + + $oldsoccanvas = dol_clone($this->object); // To avoid setting code if third party is not concerned. But if it had values, we keep them. - if (empty($this->object->client) && empty($oldsoccanvas->control->object->code_client)) $this->object->code_client=''; - if (empty($this->object->fournisseur)&& empty($oldsoccanvas->control->object->code_fournisseur)) $this->object->code_fournisseur=''; //var_dump($soccanvas);exit; + if (empty($this->object->client) && empty($oldsoccanvas->code_client)) $this->object->code_client=''; + if (empty($this->object->fournisseur) && empty($oldsoccanvas->code_fournisseur)) $this->object->code_fournisseur=''; - $result = $this->object->update($socid,$user,1,$oldsoccanvas->control->object->codeclient_modifiable(),$oldsoccanvas->control->object->codefournisseur_modifiable()); + $result = $this->object->update($this->object->id, $user, 1, $oldsoccanvas->codeclient_modifiable(), $oldsoccanvas->codefournisseur_modifiable()); if ($result >= 0) { - Header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$socid); + Header("Location: ".$_SERVER["PHP_SELF"]."?socid=".$this->object->id); exit; } else { - $this->object->id = $socid; + $this->object->id = $this->object->id; $reload = 0; $this->errors = $this->object->errors; - $_GET["action"]="edit"; + $action = "edit"; } } } } - if (GETPOST("action") == 'confirm_delete' && GETPOST("confirm") == 'yes') + if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') { - $this->object->fetch($socid); - - $result = $this->object->delete($socid); + $result = $this->object->delete($this->object->id); if ($result >= 0) { @@ -300,14 +334,14 @@ abstract class ActionsCardCommon { $reload = 0; $this->errors=$this->object->errors; - $_GET["action"]=''; + $action = ''; } } /* * Generate document */ - if (GETPOST('action') == 'builddoc') // En get ou en post + if ($action == 'builddoc') // En get ou en post { if (is_numeric(GETPOST('model'))) { @@ -317,7 +351,6 @@ abstract class ActionsCardCommon { require_once(DOL_DOCUMENT_ROOT.'/includes/modules/societe/modules_societe.class.php'); - $this->object->fetch($socid); $this->object->fetch_thirdparty(); // Define output language @@ -345,38 +378,18 @@ abstract class ActionsCardCommon } } - - /** - * Return the title of card - * - * @param string $action Type of action - * @return string HTML output - */ - private function getTitle($action) - { - global $langs; - - $out=''; - - if ($action == 'view') $out.= $langs->trans("Individual"); - if ($action == 'edit') $out.= $langs->trans("EditIndividual"); - if ($action == 'create') $out.= $langs->trans("NewIndividual"); - - return $out; - } - /** * Set content of ->tpl array, to use into template * * @param string $action Type of action * @return string HTML output */ - function assign_values($action) + function assign_values(&$action) { global $conf, $langs, $user, $mysoc, $canvas; global $form, $formadmin, $formcompany; - if ($action == 'create' || $action == 'edit') $this->assign_post(); + if ($action == 'add' || $action == 'update') $this->assign_post($action); if ($_GET["type"]=='f') { $this->object->fournisseur=1; } if ($_GET["type"]=='c') { $this->object->client=1; } @@ -389,8 +402,6 @@ abstract class ActionsCardCommon $this->tpl[$key] = $value; } - $this->tpl['title'] = $this->getTitle($action); - $this->tpl['error'] = get_htmloutput_errors($this->object->error,$this->object->errors); if ($action == 'create') @@ -546,7 +557,6 @@ abstract class ActionsCardCommon else { $head = societe_prepare_head($this->object); - $title = $this->getTitle($action); $this->tpl['showhead']=dol_get_fiche_head($head, 'card', $title, 0, 'company'); $this->tpl['showend']=dol_get_fiche_end(); @@ -666,27 +676,25 @@ abstract class ActionsCardCommon global $langs, $mysoc; $this->object->id = $_POST["socid"]; - $this->object->nom = $_POST["nom"]; + $this->object->name = $_POST["nom"]; $this->object->prefix_comm = $_POST["prefix_comm"]; $this->object->client = $_POST["client"]; $this->object->code_client = $_POST["code_client"]; $this->object->fournisseur = $_POST["fournisseur"]; $this->object->code_fournisseur = $_POST["code_fournisseur"]; - $this->object->adresse = $_POST["adresse"]; // TODO obsolete $this->object->address = $_POST["adresse"]; $this->object->zip = $_POST["zipcode"]; $this->object->town = $_POST["town"]; - $this->object->pays_id = $_POST["pays_id"]?$_POST["pays_id"]:$mysoc->pays_id; - $this->object->country_id = $_POST["pays_id"]?$_POST["pays_id"]:$mysoc->pays_id; + $this->object->country_id = $_POST["pays_id"]?$_POST["pays_id"]:$mysoc->country_id; $this->object->state_id = $_POST["departement_id"]; $this->object->tel = $_POST["tel"]; $this->object->fax = $_POST["fax"]; $this->object->email = $_POST["email"]; $this->object->url = $_POST["url"]; $this->object->capital = $_POST["capital"]; - $this->object->siren = $_POST["idprof1"]; - $this->object->siret = $_POST["idprof2"]; - $this->object->ape = $_POST["idprof3"]; + $this->object->idprof1 = $_POST["idprof1"]; + $this->object->idprof2 = $_POST["idprof2"]; + $this->object->idprof3 = $_POST["idprof3"]; $this->object->idprof4 = $_POST["idprof4"]; $this->object->typent_id = $_POST["typent_id"]; $this->object->effectif_id = $_POST["effectif_id"]; diff --git a/htdocs/societe/canvas/company/actions_card_company.class.php b/htdocs/societe/canvas/company/actions_card_company.class.php index 678625ba3cb..b7e6e344e15 100644 --- a/htdocs/societe/canvas/company/actions_card_company.class.php +++ b/htdocs/societe/canvas/company/actions_card_company.class.php @@ -1,6 +1,6 @@ - * Copyright (C) 2011 Laurent Destailleur +/* Copyright (C) 2010-2011 Regis Houssin + * Copyright (C) 2011 Laurent Destailleur * * 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 @@ -29,24 +29,27 @@ include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php'); */ class ActionsCardCompany extends ActionsCardCommon { - var $targetmodule; + var $dirmodule; + var $targetmodule; var $canvas; var $card; /** * Constructor * - * @param DoliDB $DB Handler acces base de donnees - * @param string $targetmodule Name of directory of module where canvas is stored - * @param string $canvas Name of canvas - * @param string $card Name of tab (sub-canvas) + * @param DoliDB $DB Handler acces base de donnees + * @param string $dirmodule Name of directory of module + * @param string $targetmodule Name of directory of module where canvas is stored + * @param string $canvas Name of canvas + * @param string $card Name of tab (sub-canvas) */ - function ActionsCardCompany($DB,$targetmodule,$canvas,$card) + function __construct($DB, $dirmodule, $targetmodule, $canvas, $card) { - $this->db = $DB; - $this->targetmodule = $targetmodule; - $this->canvas = $canvas; - $this->card = $card; + $this->db = $DB; + $this->dirmodule = $dirmodule; + $this->targetmodule = $targetmodule; + $this->canvas = $canvas; + $this->card = $card; } /** @@ -75,9 +78,11 @@ class ActionsCardCompany extends ActionsCardCommon * @param int $socid Id of object (may be empty for creation) * @return int <0 if KO, >0 if OK */ - function doActions($socid) + function doActions(&$action, $id) { - $return = parent::doActions($socid); + $ret = $this->getObject($id); + + $return = parent::doActions($action); return $return; } @@ -88,12 +93,16 @@ class ActionsCardCompany extends ActionsCardCommon * @param string $action Type of action * @return void */ - function assign_values($action) + function assign_values(&$action, $id) { global $conf, $langs, $user, $mysoc; global $form, $formadmin, $formcompany; + + $ret = $this->getObject($id); parent::assign_values($action); + + $this->tpl['title'] = $this->getTitle($action); $this->tpl['profid1'] = $this->object->siren; $this->tpl['profid2'] = $this->object->siret; @@ -153,7 +162,7 @@ class ActionsCardCompany extends ActionsCardCommon else { // Confirm delete third party - if ($_GET["action"] == 'delete' || $conf->use_javascript_ajax) + if ($action == 'delete') { $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteACompany"),$langs->trans("ConfirmDeleteCompany"),"confirm_delete",'',0,"1,action-delete"); } @@ -201,7 +210,7 @@ class ActionsCardCompany extends ActionsCardCommon $socm = new Societe($this->db); $socm->fetch($this->object->parent); $this->tpl['parent_company'] = $socm->getNomUrl(1).' '.($socm->code_client?"(".$socm->code_client.")":""); - $this->tpl['parent_company'].= $socm->ville?' - '.$socm->ville:''; + $this->tpl['parent_company'].= ($socm->town ? ' - ' . $socm->town : ''); } else { diff --git a/htdocs/societe/canvas/individual/actions_card_individual.class.php b/htdocs/societe/canvas/individual/actions_card_individual.class.php index 51dfe098b1b..fc6d183cb8f 100644 --- a/htdocs/societe/canvas/individual/actions_card_individual.class.php +++ b/htdocs/societe/canvas/individual/actions_card_individual.class.php @@ -28,24 +28,27 @@ include_once(DOL_DOCUMENT_ROOT.'/societe/canvas/actions_card_common.class.php'); */ class ActionsCardIndividual extends ActionsCardCommon { - var $targetmodule; + var $dirmodule; + var $targetmodule; var $canvas; var $card; /** * Constructor * - * @param DoliDB $DB Handler acces base de donnees - * @param string $targetmodule Name of directory of module where canvas is stored - * @param string $canvas Name of canvas - * @param string $card Name of tab (sub-canvas) + * @param DoliDB $DB Handler acces base de donnees + * @param string $dirmodule Name of directory of module + * @param string $targetmodule Name of directory of module where canvas is stored + * @param string $canvas Name of canvas + * @param string $card Name of tab (sub-canvas) */ - function ActionsCardIndividual($DB,$targetmodule,$canvas,$card) + function __construct($DB, $dirmodule, $targetmodule, $canvas, $card) { - $this->db = $DB; - $this->targetmodule = $targetmodule; - $this->canvas = $canvas; - $this->card = $card; + $this->db = $DB; + $this->dirmodule = $dirmodule; + $this->targetmodule = $targetmodule; + $this->canvas = $canvas; + $this->card = $card; } @@ -72,12 +75,14 @@ class ActionsCardIndividual extends ActionsCardCommon /** * Execute actions * - * @param int $socid Id of object (may be empty for creation) - * @return int <0 if KO, >0 if OK + * @param int $id Id of object (may be empty for creation) + * @return int <0 if KO, >0 if OK */ - function doActions($socid) + function doActions(&$action, $id) { - $return = parent::doActions($socid); + $ret = $this->getObject($id); + + $return = parent::doActions($action); return $return; } @@ -88,12 +93,16 @@ class ActionsCardIndividual extends ActionsCardCommon * @param string $action Type of action * @return void */ - function assign_values($action) + function assign_values(&$action, $id) { global $conf, $langs; global $form, $formcompany; + + $ret = $this->getObject($id); parent::assign_values($action); + + $this->tpl['title'] = $this->getTitle($action); if ($action == 'create' || $action == 'edit') { @@ -102,7 +111,7 @@ class ActionsCardIndividual extends ActionsCardCommon else { // Confirm delete third party - if ($_GET["action"] == 'delete' || $conf->use_javascript_ajax) + if ($action == 'delete' || $conf->use_javascript_ajax) { $this->tpl['action_delete'] = $form->formconfirm($_SERVER["PHP_SELF"]."?socid=".$this->object->id,$langs->trans("DeleteAnIndividual"),$langs->trans("ConfirmDeleteIndividual"),"confirm_delete",'',0,"1,action-delete"); } diff --git a/htdocs/societe/canvas/individual/dao_thirdparty_individual.class.php b/htdocs/societe/canvas/individual/dao_thirdparty_individual.class.php index c11d65440fb..e96e6e7f2c0 100644 --- a/htdocs/societe/canvas/individual/dao_thirdparty_individual.class.php +++ b/htdocs/societe/canvas/individual/dao_thirdparty_individual.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2010-2011 Regis Houssin * * 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 @@ -34,7 +34,7 @@ class DaoThirdPartyIndividual extends Societe * * @param DoliDB $DB Databae handler */ - function DaoThirdPartyIndividual($DB) + function __construct($DB) { $this->db = $DB; } diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index c85f5bb1e46..a8d7823341a 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -297,8 +297,7 @@ class Societe extends CommonObject $this->errors=array(); $result = 0; - $this->name=$this->name?trim($this->name):trim($this->nom); - $this->nom=$this->name; // For backward compatibility + $this->name = trim($this->name); if (! $this->name) { @@ -393,34 +392,29 @@ class Societe extends CommonObject $now=dol_now(); // Clean parameters - $this->id=$id; - $this->name=$this->name?trim($this->name):trim($this->nom); - $this->nom=trim($this->nom); // TODO obsolete - $this->address=$this->address?trim($this->address):trim($this->adresse); - $this->adresse=$this->address; // TODO obsolete - $this->zip=$this->zip?trim($this->zip):trim($this->cp); - $this->cp=$this->zip; // TODO obsolete - $this->town=$this->town?trim($this->town):trim($this->ville); - $this->ville=$this->town; // TODO obsolete - $this->state_id=trim($this->state_id); - $this->pays_id=trim($this->pays_id); - $this->country_id=trim($this->country_id); - $this->tel=trim($this->tel); - $this->fax=trim($this->fax); - $this->tel = preg_replace("/\s/","",$this->tel); - $this->tel = preg_replace("/\./","",$this->tel); - $this->fax = preg_replace("/\s/","",$this->fax); - $this->fax = preg_replace("/\./","",$this->fax); - $this->email=trim($this->email); - $this->url=$this->url?clean_url($this->url,0):''; - $this->siren=trim($this->siren); - $this->siret=trim($this->siret); - $this->ape=trim($this->ape); - $this->idprof4=trim($this->idprof4); - $this->prefix_comm=trim($this->prefix_comm); + $this->id = $id; + $this->name = trim($this->name); + $this->address = trim($this->address); + $this->zip = trim($this->zip); + $this->town = trim($this->town); + $this->state_id = trim($this->state_id); + $this->country_id = trim($this->country_id); + $this->tel = trim($this->tel); + $this->fax = trim($this->fax); + $this->tel = preg_replace("/\s/","",$this->tel); + $this->tel = preg_replace("/\./","",$this->tel); + $this->fax = preg_replace("/\s/","",$this->fax); + $this->fax = preg_replace("/\./","",$this->fax); + $this->email = trim($this->email); + $this->url = $this->url?clean_url($this->url,0):''; + $this->idprof1 = trim($this->idprof1); + $this->idprof2 = trim($this->idprof2); + $this->idprof3 = trim($this->idprof3); + $this->idprof4 = trim($this->idprof4); + $this->prefix_comm = trim($this->prefix_comm); - $this->tva_assuj=trim($this->tva_assuj); - $this->tva_intra=dol_sanitizeFileName($this->tva_intra,''); + $this->tva_assuj = trim($this->tva_assuj); + $this->tva_intra = dol_sanitizeFileName($this->tva_intra,''); if (empty($this->status)) $this->status = 0; // Local taxes @@ -477,9 +471,9 @@ class Societe extends CommonObject $sql .= ",email = ".($this->email?"'".$this->db->escape($this->email)."'":"null"); $sql .= ",url = ".($this->url?"'".$this->db->escape($this->url)."'":"null"); - $sql .= ",siren = '". $this->db->escape($this->siren) ."'"; - $sql .= ",siret = '". $this->db->escape($this->siret) ."'"; - $sql .= ",ape = '". $this->db->escape($this->ape) ."'"; + $sql .= ",siren = '". $this->db->escape($this->idprof1) ."'"; + $sql .= ",siret = '". $this->db->escape($this->idprof2) ."'"; + $sql .= ",ape = '". $this->db->escape($this->idprof3) ."'"; $sql .= ",idprof4 = '". $this->db->escape($this->idprof4) ."'"; $sql .= ",tva_assuj = ".($this->tva_assuj!=''?"'".$this->tva_assuj."'":"null"); @@ -629,7 +623,7 @@ class Societe extends CommonObject $sql .= ', s.price_level'; $sql .= ', s.tms as date_update'; $sql .= ', s.tel, s.fax, s.email, s.url, s.cp as zip, s.ville as town, s.note, s.client, s.fournisseur'; - $sql .= ', s.siren, s.siret, s.ape, s.idprof4'; + $sql .= ', s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4'; $sql .= ', s.capital, s.tva_intra'; $sql .= ', s.fk_typent as typent_id'; $sql .= ', s.fk_effectif as effectif_id'; @@ -655,9 +649,9 @@ class Societe extends CommonObject if ($ref) $sql .= " WHERE s.nom = '".$this->db->escape($ref)."' AND s.entity = ".$conf->entity; if ($ref_ext) $sql .= " WHERE s.ref_ext = '".$this->db->escape($ref_ext)."' AND s.entity = ".$conf->entity; if ($ref_int) $sql .= " WHERE s.ref_int = '".$this->db->escape($ref_int)."' AND s.entity = ".$conf->entity; - if ($idprof1) $sql .= " WHERE s.siren = '".$this->db->escape($siren)."' AND s.entity = ".$conf->entity; - if ($idprof2) $sql .= " WHERE s.siret = '".$this->db->escape($siret)."' AND s.entity = ".$conf->entity; - if ($idprof3) $sql .= " WHERE s.ape = '".$this->db->escape($ape)."' AND s.entity = ".$conf->entity; + if ($idprof1) $sql .= " WHERE s.siren = '".$this->db->escape($idprof1)."' AND s.entity = ".$conf->entity; + if ($idprof2) $sql .= " WHERE s.siret = '".$this->db->escape($idprof2)."' AND s.entity = ".$conf->entity; + if ($idprof3) $sql .= " WHERE s.ape = '".$this->db->escape($idprof3)."' AND s.entity = ".$conf->entity; if ($idprof4) $sql .= " WHERE s.idprof4 = '".$this->db->escape($idprof4)."' AND s.entity = ".$conf->entity; $resql=$this->db->query($sql); @@ -680,7 +674,7 @@ class Societe extends CommonObject $this->ref = $obj->rowid; $this->name = $obj->name; - $this->nom = $obj->name; // TODO obsolete + $this->nom = $obj->name; // TODO obsolete $this->ref_ext = $obj->ref_ext; $this->ref_int = $obj->ref_int; @@ -688,13 +682,13 @@ class Societe extends CommonObject $this->date_update = $this->db->jdate($obj->date_update); $this->address = $obj->address; - $this->adresse = $obj->address; // TODO obsolete + $this->adresse = $obj->address; // TODO obsolete $this->zip = $obj->zip; - $this->cp = $obj->zip; // TODO obsolete + $this->cp = $obj->zip; // TODO obsolete $this->town = $obj->town; - $this->ville = $obj->town;// TODO obsolete + $this->ville = $obj->town; // TODO obsolete - $this->pays_id = $obj->fk_pays; // TODO obsolete + $this->pays_id = $obj->fk_pays; // TODO obsolete $this->country_id = $obj->fk_pays; $this->pays_code = $obj->fk_pays?$obj->pays_code:''; // TODO obsolete $this->country_code = $obj->fk_pays?$obj->pays_code:''; @@ -717,11 +711,11 @@ class Societe extends CommonObject $this->parent = $obj->parent; - $this->siren = $obj->siren; // TODO obsolete + $this->siren = $obj->siren; // TODO obsolete $this->idprof1 = $obj->siren; - $this->siret = $obj->siret; // TODO obsolete + $this->siret = $obj->siret; // TODO obsolete $this->idprof2 = $obj->siret; - $this->ape = $obj->ape; // TODO obsolete + $this->ape = $obj->ape; // TODO obsolete $this->idprof3 = $obj->ape; $this->idprof4 = $obj->idprof4; diff --git a/htdocs/societe/soc.php b/htdocs/societe/soc.php index 40a0f586aec..b289e334c60 100644 --- a/htdocs/societe/soc.php +++ b/htdocs/societe/soc.php @@ -47,9 +47,9 @@ if ($conf->notification->enabled) $langs->load("mails"); $mesg=''; $error=0; $errors=array(); -$action = GETPOST('action'); -$confirm = GETPOST('confirm'); -$socid = GETPOST("socid"); +$action = (GETPOST('action') ? GETPOST('action') : 'view'); +$confirm = GETPOST('confirm'); +$socid = GETPOST("socid"); if ($user->societe_id) $socid=$user->societe_id; $object = new Societe($db); @@ -61,8 +61,8 @@ $canvas = $object->canvas?$object->canvas:GETPOST("canvas"); if (! empty($canvas)) { require_once(DOL_DOCUMENT_ROOT."/core/class/canvas.class.php"); - $objcanvas = new Canvas($db,$action); - $objcanvas->getCanvas('thirdparty','card',$canvas); + $objcanvas = new Canvas($db, $action); + $objcanvas->getCanvas('thirdparty', 'card', $canvas); } // Security check @@ -75,12 +75,11 @@ $hookmanager=new HookManager($db); $hookmanager->callHooks(array('thirdpartycard','thirdparty_extrafields')); - /* * Actions */ -$parameters=array('socid'=>$socid); +$parameters=array('id'=>$socid, 'objcanvas'=>$objcanvas); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks $error=$hookmanager->error; $errors=$hookmanager->errors; @@ -104,42 +103,33 @@ if (empty($reshook)) { require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); - if ($action == 'update') - { - $object->fetch($socid); - } + if ($action == 'update') $object->fetch($socid); if (GETPOST("private") == 1) { - $object->particulier = GETPOST("private"); + $object->particulier = GETPOST("private"); - $object->name = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?trim($_POST["prenom"].' '.$_POST["nom"]):trim($_POST["nom"].' '.$_POST["prenom"]); - $object->nom = $object->name; // TODO obsolete - $object->nom_particulier = $_POST["nom"]; - $object->prenom = $_POST["prenom"]; - $object->civilite_id = $_POST["civilite_id"]; + $object->name = empty($conf->global->MAIN_FIRSTNAME_NAME_POSITION)?trim($_POST["prenom"].' '.$_POST["nom"]):trim($_POST["nom"].' '.$_POST["prenom"]); + $object->nom_particulier = $_POST["nom"]; + $object->prenom = $_POST["prenom"]; + $object->civilite_id = $_POST["civilite_id"]; } else { - $object->name = $_POST["nom"]; - $object->nom = $object->name; // TODO obsolete + $object->name = $_POST["nom"]; } $object->address = $_POST["adresse"]; - $object->adresse = $_POST["adresse"]; // TODO obsolete $object->zip = $_POST["zipcode"]; - $object->cp = $_POST["zipcode"]; // TODO obsolete $object->town = $_POST["town"]; - $object->ville = $_POST["town"]; // TODO obsolete - $object->pays_id = $_POST["pays_id"]; $object->country_id = $_POST["pays_id"]; $object->state_id = $_POST["departement_id"]; $object->tel = $_POST["tel"]; $object->fax = $_POST["fax"]; $object->email = trim($_POST["email"]); $object->url = trim($_POST["url"]); - $object->siren = $_POST["idprof1"]; - $object->siret = $_POST["idprof2"]; - $object->ape = $_POST["idprof3"]; + $object->idprof1 = $_POST["idprof1"]; + $object->idprof2 = $_POST["idprof2"]; + $object->idprof4 = $_POST["idprof3"]; $object->idprof4 = $_POST["idprof4"]; $object->prefix_comm = $_POST["prefix_comm"]; $object->code_client = $_POST["code_client"]; @@ -159,11 +149,11 @@ if (empty($reshook)) $object->effectif_id = $_POST["effectif_id"]; if (GETPOST("private") == 1) { - $object->typent_id = 8; // TODO predict another method if the field "special" change of rowid + $object->typent_id = 8; // TODO predict another method if the field "special" change of rowid } else { - $object->typent_id = $_POST["typent_id"]; + $object->typent_id = $_POST["typent_id"]; } $object->client = $_POST["client"]; @@ -479,41 +469,14 @@ $formcompany = new FormCompany($db); $countrynotdefined=$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").')'; -// TODO Mutualize this part of code (same than product/fiche.php and contact/fiche.php) -if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) +if (is_object($objcanvas) && $objcanvas->displayCanvasExists()) { // ----------------------------------------- // When used with CANVAS // ----------------------------------------- - if ($action == 'create') - { - $objcanvas->assign_values($action); // Set value for templates - $objcanvas->display_canvas($action,0); // Show template - } - elseif ($action == 'edit') - { - $objcanvas->control->object=$objcanvas->getObject($socid); // TODO: Getting and storing object should be done into assign_values (for template with no code) or into tpl - if (empty($objcanvas->control->object)) - { - $object = new Societe($db); - $object->fetch($socid); - $objcanvas->control->object=$object; - } - $objcanvas->assign_values($action); // Set value for templates - $objcanvas->display_canvas($action); // Show template - } - else - { - $objcanvas->control->object=$objcanvas->getObject($socid); // TODO: Getting and storing object should be done into assign_values (for template with no code) or into tpl - if (empty($objcanvas->control->object)) - { - $object = new Societe($db); - $object->fetch($socid); - $objcanvas->control->object=$object; - } - $objcanvas->assign_values('view'); - $objcanvas->display_canvas('view'); // Show template - } + + $objcanvas->assign_values($action, $socid); // Set value for templates + $objcanvas->display_canvas(); // Show template } else { @@ -551,46 +514,42 @@ else if ($conf->fournisseur->enabled && (GETPOST("type")=='f' || GETPOST("type")=='')) { $object->fournisseur=1; } if (GETPOST("private")==1) { $object->particulier=1; } - $object->name=$_POST["nom"]; - $object->nom=$_POST["nom"]; // TODO obsolete - $object->prenom=$_POST["prenom"]; - $object->particulier=$_REQUEST["private"]; - $object->prefix_comm=$_POST["prefix_comm"]; - $object->client=$_POST["client"]?$_POST["client"]:$object->client; - $object->code_client=$_POST["code_client"]; - $object->fournisseur=$_POST["fournisseur"]?$_POST["fournisseur"]:$object->fournisseur; - $object->code_fournisseur=$_POST["code_fournisseur"]; - $object->adresse=$_POST["adresse"]; // TODO obsolete - $object->address=$_POST["adresse"]; - $object->cp=$_POST["zipcode"]; // TODO obsolete - $object->zip=$_POST["zipcode"]; - $object->ville=$_POST["town"]; // TODO obsolete - $object->town=$_POST["town"]; - $object->state_id=$_POST["departement_id"]; - $object->tel=$_POST["tel"]; - $object->fax=$_POST["fax"]; - $object->email=$_POST["email"]; - $object->url=$_POST["url"]; - $object->capital=$_POST["capital"]; - $object->gencod=$_POST["gencod"]; - $object->siren=$_POST["idprof1"]; - $object->siret=$_POST["idprof2"]; - $object->ape=$_POST["idprof3"]; - $object->idprof4=$_POST["idprof4"]; - $object->typent_id=$_POST["typent_id"]; - $object->effectif_id=$_POST["effectif_id"]; + $object->name = $_POST["nom"]; + $object->prenom = $_POST["prenom"]; + $object->particulier = $_REQUEST["private"]; + $object->prefix_comm = $_POST["prefix_comm"]; + $object->client = $_POST["client"]?$_POST["client"]:$object->client; + $object->code_client = $_POST["code_client"]; + $object->fournisseur = $_POST["fournisseur"]?$_POST["fournisseur"]:$object->fournisseur; + $object->code_fournisseur = $_POST["code_fournisseur"]; + $object->address = $_POST["adresse"]; + $object->zip = $_POST["zipcode"]; + $object->town = $_POST["town"]; + $object->state_id = $_POST["departement_id"]; + $object->tel = $_POST["tel"]; + $object->fax = $_POST["fax"]; + $object->email = $_POST["email"]; + $object->url = $_POST["url"]; + $object->capital = $_POST["capital"]; + $object->gencod = $_POST["gencod"]; + $object->idprof1 = $_POST["idprof1"]; + $object->idprof2 = $_POST["idprof2"]; + $object->idprof3 = $_POST["idprof3"]; + $object->idprof4 = $_POST["idprof4"]; + $object->typent_id = $_POST["typent_id"]; + $object->effectif_id = $_POST["effectif_id"]; - $object->tva_assuj = $_POST["assujtva_value"]; - $object->status= $_POST["status"]; + $object->tva_assuj = $_POST["assujtva_value"]; + $object->status = $_POST["status"]; //Local Taxes - $object->localtax1_assuj = $_POST["localtax1assuj_value"]; - $object->localtax2_assuj = $_POST["localtax2assuj_value"]; + $object->localtax1_assuj = $_POST["localtax1assuj_value"]; + $object->localtax2_assuj = $_POST["localtax2assuj_value"]; - $object->tva_intra=$_POST["tva_intra"]; + $object->tva_intra = $_POST["tva_intra"]; - $object->commercial_id=$_POST["commercial_id"]; - $object->default_lang=$_POST["default_lang"]; + $object->commercial_id = $_POST["commercial_id"]; + $object->default_lang = $_POST["default_lang"]; $object->logo = dol_sanitizeFileName($_FILES['photo']['name']); From 7c3fc4cdc4edf2e1e3d03239f9c3b1dd5a4554f1 Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Sat, 24 Sep 2011 19:09:28 +0200 Subject: [PATCH 8/8] remove gitmodules --- .gitmodules | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules deleted file mode 100644 index 5627b9e58ac..00000000000 --- a/.gitmodules +++ /dev/null @@ -1,48 +0,0 @@ -[submodule "htdocs/custom/productdiscount"] - path = htdocs/custom/productdiscount - url = git+ssh://hregis@scm.doliforge.org/gitroot/productdiscount/productdiscount.git -[submodule "htdocs/custom/multicompany"] - path = htdocs/custom/multicompany - url = git+ssh://hregis@scm.doliforge.org/gitroot/multicompany/multicompany.git -[submodule "htdocs/custom/paypalplus"] - path = htdocs/custom/paypalplus - url = git+ssh://hregis@scm.doliforge.org/gitroot/paypalplus/paypalplus.git -[submodule "htdocs/custom/milestone"] - path = htdocs/custom/milestone - url = git+ssh://hregis@scm.doliforge.org/gitroot/milestone/milestone.git -[submodule "htdocs/custom/dropbox"] - path = htdocs/custom/dropbox - url = git+ssh://hregis@scm.doliforge.org/gitroot/dropbox/dropbox.git -[submodule "htdocs/custom/docgen"] - path = htdocs/custom/docgen - url = git+ssh://hregis@scm.doliforge.org/gitroot/docgen/docgen.git -[submodule "htdocs/custom/extrafields"] - path = htdocs/custom/extrafields - url = git+ssh://hregis@scm.doliforge.org/gitroot/extrafields/extrafields.git -[submodule "htdocs/custom/business"] - path = htdocs/custom/business - url = git+ssh://hregis@scm.doliforge.org/gitroot/business/business.git -[submodule "htdocs/custom/agefodd"] - path = htdocs/custom/agefodd - url = git+ssh://hregis@scm.doliforge.org/gitroot/agefodd/agefodd.git -[submodule "htdocs/custom/genfac"] - path = htdocs/custom/genfac - url = git+ssh://hregis@scm.doliforge.org/gitroot/massfacturation/massfacturation.git -[submodule "htdocs/custom/lead"] - path = htdocs/custom/lead - url = git+ssh://hregis@scm.doliforge.org/gitroot/lead/lead.git -[submodule "htdocs/custom/team"] - path = htdocs/custom/team - url = git+ssh://hregis@scm.doliforge.org/gitroot/team/team.git -[submodule "htdocs/custom/highcharts"] - path = htdocs/custom/highcharts - url = git+ssh://hregis@scm.doliforge.org/gitroot/highcharts/highcharts.git -[submodule "htdocs/custom/joomla"] - path = htdocs/custom/joomla - url = git+ssh://hregis@scm.doliforge.org/gitroot/joomla/joomla.git -[submodule "htdocs/custom/donation"] - path = htdocs/custom/donation - url = git+ssh://hregis@scm.doliforge.org/gitroot/capnetworks/donate.git -[submodule "htdocs/custom/fidppi"] - path = htdocs/custom/fidppi - url = git+ssh://hregis@doliforge.org/gitroot/fidppi/fidppi.git
'.$langs->trans("Groups").''.$langs->trans("Entity").''.$object->nom; if (empty($object->entity)) { - print img_redstar($langs->trans("GlobalGroup")); + print img_picto($langs->trans("GlobalGroup"),'redstar'); } print "