浏览代码

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

Conflicts:
	htdocs/don/document.php
Laurent Destailleur 8 年之前
父节点
当前提交
341e014a3d

+ 2 - 2
htdocs/admin/confexped.php

@@ -87,14 +87,14 @@ else if ($action == 'disable_delivery')
 $dir = DOL_DOCUMENT_ROOT."/core/modules/expedition/";
 $form=new Form($db);
 
-llxHeader("","");
+llxHeader("",$langs->trans("SendingsSetup"));
 
 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
 print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');
 print '<br>';
 $head = expedition_admin_prepare_head();
 
-dol_fiche_head($head, 'general', $langs->trans("ModuleSetup"), 0, 'sending');
+dol_fiche_head($head, 'general', $langs->trans("Sendings"), 0, 'sending');
 
 /*
  * Formulaire parametres divers

+ 1 - 1
htdocs/admin/expedition.php

@@ -215,7 +215,7 @@ $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
 
 $form=new Form($db);
 
-llxHeader("","");
+llxHeader("",$langs->trans("SendingsSetup"));
 
 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
 print load_fiche_titre($langs->trans("SendingsSetup"),$linkback,'title_setup');

+ 5 - 4
htdocs/contact/class/contact.class.php

@@ -123,15 +123,16 @@ class Contact extends CommonObject
 	
 		$sql = "SELECT count(sp.rowid) as nb";
 		$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
-		$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON (sp.fk_soc = s.rowid)";
 		if (!$user->rights->societe->client->voir && !$user->societe_id)
 		{
-			$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
+		    $sql.= " OUTER JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
+		    $sql.= " OUTER JOIN ".MAIN_DB_PREFIX."societe_commerciaux as sc ON s.rowid = sc.fk_soc";
 			$sql.= " WHERE sc.fk_user = " .$user->id;
 			$clause = "AND";
 		}
-		$sql.= ' '.$clause.' s.entity IN ('.getEntity($this->element, 1).')';
-	
+		$sql.= ' '.$clause.' sp.entity IN ('.getEntity($this->element, 1).')';
+        if ($user->societe_id > 0) $sql.=" AND sp.fk_soc = ".$user->societe_id;
+        
 		$resql=$this->db->query($sql);
 		if ($resql)
 		{

+ 2 - 2
htdocs/core/class/commonobject.class.php

@@ -4444,12 +4444,12 @@ abstract class CommonObject
 					}
 					if ( !empty($conf->global->MAIN_EXTRAFIELDS_USE_TWO_COLUMS) && ($e % 2) == 0)
 					{
-						$out .= '<tr '.$class.$csstyle.'>';
+						$out .= '<tr '.$class.$csstyle.' class="'.$this->element.'_extras_'.$key.'">';
 						$colspan='0';
 					}
 					else
 					{
-						$out .= '<tr '.$class.$csstyle.'>';
+						$out .= '<tr '.$class.$csstyle.' class="'.$this->element.'_extras_'.$key.'">';
 					}
 					// Convert date into timestamp format
 					if (in_array($extrafields->attribute_type[$key],array('date','datetime')))

+ 2 - 1
htdocs/core/lib/ajax.lib.php

@@ -322,7 +322,8 @@ function ajax_dialog($title,$message,$w=350,$h=150)
 {
 	global $langs;
 
-	$msg= '<div id="dialog-info" title="'.dol_escape_htmltag($title).'">';
+	$newtitle=dol_textishtml($title)?dol_string_nohtmltag($title,1):$title;
+	$msg= '<div id="dialog-info" title="'.dol_escape_htmltag($newtitle).'">';
 	$msg.= $message;
 	$msg.= '</div>'."\n";
     $msg.= '<script type="text/javascript">

+ 9 - 0
htdocs/core/lib/donation.lib.php

@@ -89,6 +89,15 @@ function donation_prepare_head($object)
 	$head[$h][2] = 'documents';
 	$h++;
 
+	$nbNote = 0;
+	if(!empty($object->note_private)) $nbNote++;
+	if(!empty($object->note_public)) $nbNote++;
+	$head[$h][0] = DOL_URL_ROOT.'/don/note.php?id='.$object->id;
+	$head[$h][1] = $langs->trans("Notes");
+	if ($nbNote > 0) $head[$h][1].= ' <span class="badge">'.$nbNote.'</span>';
+	$head[$h][2] = 'note';
+	$h++;
+	
 	$head[$h][0] = DOL_URL_ROOT . '/don/info.php?id=' . $object->id;
 	$head[$h][1] = $langs->trans("Info");
 	$head[$h][2] = 'info';

+ 0 - 2
htdocs/don/document.php

@@ -107,7 +107,6 @@ if ($object->id)
 		$totalsize+=$file['size'];
 	}
 
-
 	$linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php'.(! empty($socid)?'?socid='.$socid:'').'">'.$langs->trans("BackToList").'</a>';
 	
 	$morehtmlref='<div class="refidno">';
@@ -153,7 +152,6 @@ if ($object->id)
 	
     print '<table class="border" width="100%">';
 
-
 	// Ref
 	/*
 	print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';

+ 99 - 0
htdocs/don/note.php

@@ -0,0 +1,99 @@
+<?php
+/* Copyright (C) 2004      Rodolphe Quiedeville <rodolphe@quiedeville.org>
+ * Copyright (C) 2004-2008 Laurent Destailleur  <eldy@users.sourceforge.net>
+ * Copyright (C) 2005-2012 Regis Houssin        <regis.houssin@capnetworks.com>
+ * Copyright (C) 2013      Florian Henry		  	<florian.henry@open-concept.pro>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ *      \file       htdocs/compta/facture/note.php
+ *      \ingroup    facture
+ *      \brief      Fiche de notes sur une facture
+ */
+
+require '../main.inc.php';
+require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/donation.lib.php';
+require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
+
+$langs->load("companies");
+$langs->load("bills");
+$langs->load("donations");
+
+$id=(GETPOST('id','int')?GETPOST('id','int'):GETPOST('facid','int'));  // For backward compatibility
+$ref=GETPOST('ref','alpha');
+$action=GETPOST('action','alpha');
+
+// Security check
+$socid=0;
+if ($user->societe_id) $socid=$user->societe_id;
+$result=restrictedArea($user,'don',$id,'');
+
+$object = new Don($db);
+$object->fetch($id);
+
+$permissionnote=$user->rights->don->creer;	// Used by the include of actions_setnotes.inc.php
+
+
+/*
+ * Actions
+ */
+
+include DOL_DOCUMENT_ROOT.'/core/actions_setnotes.inc.php';	// Must be include, not includ_once
+
+
+
+/*
+ * View
+ */
+
+$title = $langs->trans('Donation') . " - " . $langs->trans('Notes');
+$helpurl = "";
+llxHeader('', $title, $helpurl);
+
+$form = new Form($db);
+
+if ($id > 0 || ! empty($ref))
+{
+	$object = new Don($db);
+	$object->fetch($id,$ref);
+
+    $head = donation_prepare_head($object);
+
+    dol_fiche_head($head, 'note', $langs->trans("Donation"), 0, 'generic');
+    
+    $linkback = '<a href="'.DOL_URL_ROOT.'/don/list.php">'.$langs->trans("BackToList").'</a>';
+    
+    print '<table class="border" width="100%">';
+
+    // Ref
+    print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
+    print $form->showrefnav($object, 'id', $linkback, 1, 'rowid', 'ref', '');
+    print '</td></tr>';
+
+    print "</table>";
+
+    print '<br>';
+
+	include DOL_DOCUMENT_ROOT.'/core/tpl/notes.tpl.php';
+
+	dol_fiche_end();
+}
+
+
+llxFooter();
+
+$db->close();

+ 1 - 1
htdocs/langs/en_US/main.lang

@@ -635,7 +635,7 @@ PrintContentArea=Show page to print main content area
 MenuManager=Menu manager
 WarningYouAreInMaintenanceMode=Warning, you are in a maintenance mode, so only login <b>%s</b> is allowed to use application at the moment.
 CoreErrorTitle=System error
-CoreErrorMessage=Sorry, an error occurred. Check the logs or contact your system administrator.
+CoreErrorMessage=Sorry, an error occurred. Contact your system administrator to check the logs or disable $dolibarr_main_prod=1 to get more information.
 CreditCard=Credit card
 FieldsWithAreMandatory=Fields with <b>%s</b> are mandatory
 FieldsWithIsForPublic=Fields with <b>%s</b> are shown on public list of members. If you don't want this, check off the "public" box.

+ 1 - 1
htdocs/main.inc.php

@@ -1887,7 +1887,7 @@ if (! function_exists("llxFooter"))
                 print '<div class="error">'.$msg.'</div>';
             }
 
-            define("MAIN_CORE_ERROR",0);
+            //define("MAIN_CORE_ERROR",0);      // Constant was defined and we can't change value of a constant
         }
 
         print "\n\n";

+ 1 - 1
scripts/cron/cron_run_jobs.php

@@ -82,7 +82,7 @@ if ($key != $conf->global->CRON_KEY)
 // If param userlogin is reserved word 'firstadmin' 
 if ($userlogin == 'firstadmin')
 {
-    $sql='SELECT login from '.MAIN_DB_PREFIX.'user WHERE admin = 1 ORDER BY entity LIMIT 1';
+    $sql='SELECT login from '.MAIN_DB_PREFIX.'user WHERE admin = 1 and statut = 1 ORDER BY entity LIMIT 1';
     $resql=$db->query($sql);
     if ($resql)
     {