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

This commit is contained in:
Laurent Destailleur 2015-12-03 13:06:37 +01:00
commit 1658bee81c
7 changed files with 48 additions and 13 deletions

View File

@ -113,11 +113,11 @@ print '</tr>';
print "</table>\n";
print '</form>';
dol_fiche_end();
print '<div style="text-align:center"><input type="submit" class="button" value="'.$langs->trans('Modify').'" name="button"></div>';
print '</form>';
llxFooter();
$db->close();

View File

@ -830,7 +830,7 @@ if (empty($reshook))
setEventMessages($object->error, $object->errors, 'errors');
}
$result = $object->setValueFrom('ref',GETPOST('ref','alpha'));;
$result = $object->setValueFrom('ref',GETPOST('ref','alpha'));
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'editref';
@ -843,6 +843,30 @@ if (empty($reshook))
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
exit;
}
}
elseif ($action=='setdate_contrat')
{
$cancelbutton = GETPOST('cancel');
if (!$cancelbutton) {
$result = $object->fetch($id);
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
}
$datacontrat=dol_mktime(GETPOST('date_contrathour'), GETPOST('date_contratmin'), 0, GETPOST('date_contratmonth'), GETPOST('date_contratday'), GETPOST('date_contratyear'));
$result = $object->setValueFrom('date_contrat',$datacontrat,'',null,'date');
if ($result < 0) {
setEventMessages($object->error, $object->errors, 'errors');
$action = 'editdate_contrat';
} else {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $object->id);
exit;
}
}
else {
header("Location: " . $_SERVER['PHP_SELF'] . "?id=" . $id);
exit;
}
}
// Generation doc (depuis lien ou depuis cartouche doc)
@ -1278,8 +1302,15 @@ else
print "</td></tr>";
// Date
print '<tr><td>'.$langs->trans("Date").'</td>';
print '<td colspan="3">'.dol_print_date($object->date_contrat,"dayhour")."</td></tr>\n";
print '<tr>';
print '<td width="20%">';
print $form->editfieldkey("Date",'date_contrat',$object->date_contrat,$object,$user->rights->contrat->creer);
print '</td><td>';
print $form->editfieldval("Date",'date_contrat',$object->date_contrat,$object,$user->rights->contrat->creer,'datehourpicker');
print '</td>';
print '</tr>';
/* print '<tr><td>'.$langs->trans("Date").'</td>';
print '<td colspan="3">'.dol_print_date($object->date_contrat,"dayhour")."</td></tr>\n";*/
// Projet
if (! empty($conf->projet->enabled))

View File

@ -221,7 +221,7 @@ abstract class DoliDB implements Database
* Define sort criteria of request
*
* @param string $sortfield List of sort fields, separated by comma. Example: 't1.fielda, t2.fieldb'
* @param string $sortorder Sort order
* @param 'ASC'|'DESC' $sortorder Sort order
* @return string String to provide syntax of a sort sql string
*/
function order($sortfield=null,$sortorder=null)
@ -236,9 +236,11 @@ abstract class DoliDB implements Database
else $return.=',';
$return.=preg_replace('/[^0-9a-z_\.]/i','',$val);
if (! empty($sortorder))
{
$return.=' '.preg_replace('/[^0-9a-z]/i','',$sortorder);
// Only ASC and DESC values are valid SQL
if ($sortorder === 'ASC') {
$return .= ' ASC';
} elseif ($sortorder === 'DESC') {
$return .= ' DESC';
}
}
return $return;

View File

@ -864,8 +864,8 @@ function confirmConstantAction(action, url, code, input, box, entity, yesButton,
.addClass( "ui-widget ui-widget-content ui-corner-left dolibarrcombobox" );
input.data("ui-autocomplete")._renderItem = function( ul, item ) {
return $("<li></li>")
.data( "item.autocomplete", item )
return $("<li>")
.data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0
.append( "<a>" + item.label + "</a>" )
.appendTo( ul );
};

View File

@ -170,8 +170,8 @@ function ajax_autocompleter($selected, $htmlname, $url, $urloption='', $minLengt
}
,delay: 500
}).data("ui-autocomplete")._renderItem = function( ul, item ) {
return $("<li></li>")
.data( "item.autocomplete", item )
return $("<li>")
.data( "ui-autocomplete-item", item ) // jQuery UI > 1.10.0
.append( \'<a><span class="tag">\' + item.label + "</span></a>" )
.appendTo(ul);
};

View File

@ -313,3 +313,4 @@ PropalMergePdfProductChooseFile=Select PDF files
IncludingProductWithTag=Including product/service with tag
DefaultPriceRealPriceMayDependOnCustomer=Default price, real price may depend on customer
WarningSelectOneDocument=Please select at least one document
DefaultUnitToShow=Units

View File

@ -297,3 +297,4 @@ PropalMergePdfProductChooseFile=Sélectionnez les fichiers PDF
IncludingProductWithTag=Incluant un produit ayant le tag/catégorie
DefaultPriceRealPriceMayDependOnCustomer=Prix par défaut, le prix réel peut dépendre du client
WarningSelectOneDocument=Sélectionnez au moins un document
DefaultUnitToShow=Unités