Laurent Destailleur 3 سال پیش
والد
کامیت
477d681c49

+ 3 - 2
htdocs/admin/commande.php

@@ -302,6 +302,7 @@ foreach ($dirmodels as $reldir) {
 						$htmltooltip = '';
 						$htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
 						$commande->type = 0;
+
 						$nextval = $module->getNextValue($mysoc, $commande);
 						if ("$nextval" != $langs->trans("NotAvailable")) {  // Keep " on nextval
 							$htmltooltip .= ''.$langs->trans("NextValue").': ';
@@ -614,7 +615,7 @@ if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT)) {
 	print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
 } else {
 	include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
-	$doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
+	$doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
 	print $doleditor->Create();
 }
 print '</td><td class="right">';
@@ -630,7 +631,7 @@ print "<input type=\"hidden\" name=\"action\" value=\"set_COMMANDE_DRAFT_WATERMA
 print '<tr class="oddeven"><td>';
 print $form->textwithpicto($langs->trans("WatermarkOnDraftOrders"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
 print '</td><td>';
-print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.$conf->global->COMMANDE_DRAFT_WATERMARK.'">';
+print '<input class="flat minwidth200" type="text" name="COMMANDE_DRAFT_WATERMARK" value="'.getDolGlobalString('COMMANDE_DRAFT_WATERMARK').'">';
 print '</td><td class="right">';
 print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
 print "</td></tr>\n";

+ 6 - 0
htdocs/core/class/commondocgenerator.class.php

@@ -60,6 +60,12 @@ abstract class CommonDocGenerator
 	 */
 	public $update_main_doc_field;
 
+	/**
+	 * @var string	The name of constant to use to scan ODT files (Exemple: 'COMMANDE_ADDON_PDF_ODT_PATH')
+	 */
+	public $scandir;
+
+
 	/**
 	 *	Constructor
 	 *

+ 6 - 2
htdocs/core/modules/commande/mod_commande_saphir.php

@@ -104,7 +104,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
 		$old_code_type = $mysoc->typent_code;
 		$mysoc->code_client = 'CCCCCCCCCC';
 		$mysoc->typent_code = 'TTTTTTTTTT';
-		$numExample = $this->getNextValue($mysoc, '');
+		$numExample = $this->getNextValue($mysoc, null);
 		$mysoc->code_client = $old_code_client;
 		$mysoc->typent_code = $old_code_type;
 
@@ -138,7 +138,11 @@ class mod_commande_saphir extends ModeleNumRefCommandes
 		// Get entities
 		$entity = getEntity('ordernumber', 1, $object);
 
-		$date = ($object->date_commande ? $object->date_commande : $object->date);
+		if (is_object($object)) {
+			$date = ($object->date_commande ? $object->date_commande : $object->date);
+		} else {
+			$date = dol_now();
+		}
 
 		$numFinal = get_next_value($db, $mask, 'commande', 'ref', '', $objsoc, $date, 'next', false, null, $entity);
 

+ 1 - 1
htdocs/main.inc.php

@@ -2498,7 +2498,7 @@ function printDropdownQuickadd()
 	$parameters = array();
 	$hook_items = $items;
 	$reshook = $hookmanager->executeHooks('menuDropdownQuickaddItems', $parameters, $hook_items); // Note that $action and $object may have been modified by some hooks
-	if (is_numeric($reshook) && is_array($hookmanager->results)) {
+	if (is_numeric($reshook) && !empty($hookmanager->results) && is_array($hookmanager->results)) {
 		if ($reshook == 0) {
 			$items['items'] = array_merge($items['items'], $hookmanager->results); // add
 		} else {