Parcourir la source

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

Laurent Destailleur il y a 2 ans
Parent
commit
767897595b

+ 8 - 9
htdocs/accountancy/class/bookkeeping.class.php

@@ -1123,14 +1123,13 @@ class BookKeeping extends CommonObject
 	/**
 	 * Load object in memory from the database
 	 *
-	 * @param string $sortorder Sort Order
-	 * @param string $sortfield Sort field
-	 * @param int $limit offset limit
-	 * @param int $offset offset limit
-	 * @param array $filter filter array
-	 * @param string $filtermode filter mode (AND or OR)
-	 *
-	 * @return int <0 if KO, >0 if OK
+	 * @param 	string 	$sortorder 		Sort Order
+	 * @param 	string 	$sortfield 		Sort field
+	 * @param 	int 	$limit 			offset limit
+	 * @param 	int 	$offset 		offset limit
+	 * @param 	array 	$filter 		filter array
+	 * @param 	string 	$filtermode 	filter mode (AND or OR)
+	 * @return 	int 					<0 if KO, >0 if OK
 	 */
 	public function fetchAllBalance($sortorder = '', $sortfield = '', $limit = 0, $offset = 0, array $filter = array(), $filtermode = 'AND')
 	{
@@ -1151,7 +1150,7 @@ class BookKeeping extends CommonObject
 			foreach ($filter as $key => $value) {
 				if ($key == 't.doc_date') {
 					$sqlwhere[] = $key." = '".$this->db->idate($value)."'";
-				} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=') {
+				} elseif ($key == 't.doc_date>=' || $key == 't.doc_date<=' || $key == 't.doc_date>' || $key == 't.doc_date<') {
 					$sqlwhere[] = $key."'".$this->db->idate($value)."'";
 				} elseif ($key == 't.numero_compte>=' || $key == 't.numero_compte<=' || $key == 't.subledger_account>=' || $key == 't.subledger_account<=') {
 					$sqlwhere[] = $key."'".$this->db->escape($value)."'";

+ 4 - 4
htdocs/compta/recap-compta.php

@@ -267,12 +267,12 @@ if ($id > 0) {
 
 				print '<tr class="oddeven '.$html_class.'">';
 
-				print "<td class=\"center\">";
+				$datedetail = dol_print_date($data['date'], 'dayhour');
 				if (!empty($data['fk_facture'])) {
-					print dol_print_date($data['date'], 'day');
-				} elseif (!empty($data['fk_paiement'])) {
-					print dol_print_date($data['date'], 'dayhour');
+					$datedetail = dol_print_date($data['date'], 'day');
 				}
+				print '<td class="center" title="'.dol_escape_htmltag($datedetail).'">';
+				print dol_print_date($data['date'], 'day');
 				print "</td>\n";
 
 				print '<td>'.$data['link']."</td>\n";

+ 16 - 3
htdocs/projet/class/project.class.php

@@ -854,11 +854,24 @@ class Project extends CommonObject
 		$listoftables = array(
 			'propal'=>'fk_projet', 'commande'=>'fk_projet', 'facture'=>'fk_projet',
 			'supplier_proposal'=>'fk_projet', 'commande_fournisseur'=>'fk_projet', 'facture_fourn'=>'fk_projet',
-			'expensereport_det'=>'fk_projet', 'contrat'=>'fk_projet', 'fichinter'=>'fk_projet', 'don'=>'fk_projet',
-			'actioncomm'=>'fk_project', 'mrp_mo'=>'fk_project', 'entrepot'=>'fk_project'
+			'expensereport_det'=>'fk_projet', 'contrat'=>'fk_projet',
+			'fichinter'=>'fk_projet',
+			'don'=>array('field'=>'fk_projet', 'module'=>'don'),
+			'actioncomm'=>'fk_project',
+			'mrp_mo'=>'fk_project',
+			'entrepot'=>'fk_project'
 		);
 		foreach ($listoftables as $key => $value) {
-			$sql = "UPDATE ".MAIN_DB_PREFIX.$key." SET ".$value." = NULL where ".$value." = ".((int) $this->id);
+			if (is_array($value)) {
+				if (!isModEnabled($value['module'])) {
+					continue;
+				}
+				$fieldname = $value['field'];
+			} else {
+				$fieldname = $value;
+			}
+			$sql = "UPDATE ".MAIN_DB_PREFIX.$key." SET ".$fieldname." = NULL where ".$fieldname." = ".((int) $this->id);
+
 			$resql = $this->db->query($sql);
 			if (!$resql) {
 				$this->errors[] = $this->db->lasterror();

+ 2 - 2
htdocs/user/group/list.php

@@ -215,14 +215,14 @@ if ($resql) {
 		print '<tr class="oddeven">';
 		print '<td>';
 		print $grouptemp->getNomUrl(1);
-		if (!$obj->entity) {
+		if (isModEnabled('multicompany') && !$obj->entity) {
 			print img_picto($langs->trans("GlobalGroup"), 'redstar');
 		}
 		print "</td>";
 		//multicompany
 		if (isModEnabled('multicompany') && is_object($mc) && empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE) && $conf->entity == 1) {
 			$mc->getInfo($obj->entity);
-			print '<td class="center">'.$mc->label.'</td>';
+			print '<td class="center">'.dol_escape_htmltag($mc->label).'</td>';
 		}
 		print '<td class="center">'.$obj->nb.'</td>';
 		print '<td class="center">';

+ 10 - 0
htdocs/website/index.php

@@ -3819,7 +3819,17 @@ if ($action == 'editmeta' || $action == 'createcontainer') {	// Edit properties
 		$pagestatus = $objectpage->status;
 	} else {
 		$type_container = 'page';
+		$pageurl = '';
+		$pagealiasalt = '';
+		$pagetitle = '';
+		$pagedescription = '';
+		$pageimage = '';
+		$pagekeywords = '';
+		$pagelang = '';
+		$pageallowedinframes = 0;
+		$pagehtmlheader = '';
 		$pagedatecreation = dol_now();
+		$pagedatemodification = '';
 		$pageauthorid = $user->id;
 		$pageusermodifid = 0;
 		$pageauthoralias = '';