Permalink
Browse files

fix affichage du menu déroulant

  • Loading branch information...
synry63 committed May 11, 2012
1 parent 0035ba2 commit 6ba73e023e79f06b836fff2168b7d9ff2f83ee99
Showing with 35 additions and 88 deletions.
  1. +26 −19 etatstock.php
  2. +9 −69 mouvement.php
View
@@ -27,7 +27,7 @@
if (! $res) $res=@include("../main.inc.php");
dol_include_once("/stock2/class/stock2.class.php");
-$object = new Stock($db);
+$object = new Stock2($db);
/*if($_GET['entrepot'] && $_GET['display']){
//$result = $object->getView("listByPrestataire",$_GET['entrepot']);
@@ -129,6 +129,10 @@
else{
$optionsDisplay .= '<option value="piece">Par Pièce</option>';
}
+
+print'<div class="row">';
+print start_box("Selection","twelve","16-Download.png",true,true);
+
print'<form class="entete_etatstock" action="etatstock.php" method="post">';
print'<label>'.$langs->trans("Affichage : ") .'</label>';
@@ -140,6 +144,13 @@
print'<input type="submit" class="submit" value="'. $langs->trans("Valider").'">';
print'</form>';
+print end_box();
+print'</div>';
+
+print'<div class="row">';
+print start_box("Liste des stocks","twelve","16-List-w_-Images.png",false,false);
+
+
$i=0;
$obj=new stdClass();
/*table views */
@@ -227,6 +238,7 @@
print 'Emplacement';
print'</th>';
$obj->aoColumns[$i]->mDataProp = "emplacement";
+ $obj->aoColumns[$i]->sDefaultContent = "";
$obj->aoColumns[$i]->fnRender = '%function(obj) {
var str = obj.aData.emplacement;
if(typeof str === $undefined$)
@@ -238,6 +250,7 @@
print 'Référence pièce';
print'</th>';
$obj->aoColumns[$i]->mDataProp = "reference";
+ $obj->aoColumns[$i]->sDefaultContent = "";
$obj->aoColumns[$i]->fnRender = '%function(obj) {
var str = obj.aData.reference;
if(typeof str === $undefined$)
@@ -250,6 +263,7 @@
print 'Numéro de série';
print'</th>';
$obj->aoColumns[$i]->mDataProp = "serie";
+ $obj->aoColumns[$i]->sDefaultContent = "";
$obj->aoColumns[$i]->fnRender = '%function(obj) {
var str = obj.aData.serie;
if(typeof str === $undefined$)
@@ -304,33 +318,26 @@
$obj->aaSortingFixed=array(array(0,'asc'));
$obj->aaSorting=array(array(1,'asc'));
$i=1;
-print'<thead class="recherche">';
+print'<tfoot>';
print'<tr>';
-print'<td id='.$i.'><input style="margin-top:1px;" type="text" placeholder="' . $langs->trans("Search Réf pièce") . '" class="inputSearch"/></td>';
+print'<tr>';
+print'<td id='.$i.'><input style="margin-top:1px;" type="text" placeholder="' . $langs->trans("Search Réf pièce") . '"/></td>';
$i++;
-print'<td id='.$i.'><input style="margin-top:1px;" type="text" placeholder="' . $langs->trans("Search Num série") . '" class="inputSearch" /></td>';
+print'<td id='.$i.'><input style="margin-top:1px;" type="text" placeholder="' . $langs->trans("Search Num série") . '"/></td>';
$i++;
-print'<td id='.$i.'><input style="margin-top:1px;" type="text" placeholder="' . $langs->trans("Search Quantité") . '" class="inputSearch" /></td>';
+print'<td id='.$i.'><input style="margin-top:1px;" type="text" placeholder="' . $langs->trans("Search Quantité") . '"/></td>';
print'</tr>';
-print'</thead>';
+print'</tfoot>';
print'<tbody>';
print'</tbody>';
-
-print $object->_datatables($obj,"#etatstock");
-
+print $object->_datatables($obj,"etatstock",true,true);
print'</table>';
-print'<script type="text/javascript" charset="utf-8">
- $(document).ready(function() {';
- /*seach on column */
-print '$("thead input").keyup( function () {
- /* Filter on the column (the index) of this element */
- var index = $("thead input").index(this)+1;
- oTable.fnFilter( this.value, (index));
-});';
-print'});';
-print '</script>';
+print end_box();
+print '</div>';
+
+llxFooter();
?>
View
@@ -111,20 +111,8 @@
/* active datatable js */
$arrayjs = array();
$arrayjs[0] = "/custom/stock2/lib/datatables/js/indicateurTracking.js";
-$arrayjs[1] = "/custom/stock2/lib/datatables/js/KeyTable.js";
llxHeader("","","","","","",$arrayjs);
-print'<style type="text/css" media="screen">';
-print'
-table.KeyTable td.focus {
- border: 3px solid #3366FF;
-}
-table.KeyTable td{
- border:none;
-
-}';
-print '</style>';
-
print'<div class="row">';
print start_box("Saisie des mouvements","twelve","16-Download.png",true,true);
@@ -166,6 +154,7 @@
print'</th>';
$obj->aoColumns[$i]->mDataProp = "_id";
$obj->aoColumns[$i]->bVisible = false;
+
$i++;
print'<th class="essential">';
print 'Nom operateur';
@@ -177,6 +166,7 @@
print'</th>';
$obj->aoColumns[$i]->mDataProp = "datetime";
$obj->aoColumns[$i]->sType="date";
+ $obj->aoColumns[$i]->sClass = "edit";
$obj->aoColumns[$i]->fnRender = '%function(obj) {
if(obj.aData.datetime)
{
@@ -191,12 +181,14 @@
print 'Numero de tracking';
print'</th>';
$obj->aoColumns[$i]->mDataProp = "tracking";
+ $obj->aoColumns[$i]->sClass = "edit";
$obj->aoColumns[$i]->sDefaultContent = "";
$i++;
print'<th class="essential">';
print 'Mouvement colis';
print'</th>';
$obj->aoColumns[$i]->mDataProp = "codemouv";
+ $obj->aoColumns[$i]->sClass = "edit";
$obj->aoColumns[$i]->sDefaultContent = "";
$obj->aoColumns[$i]->fnRender = '%function(obj) {
var str = obj.aData.codeprestataire+obj.aData.codemouv;
@@ -209,18 +201,21 @@
print 'Référence pièce';
print'</th>';
$obj->aoColumns[$i]->mDataProp = "reference";
+ $obj->aoColumns[$i]->sClass = "edit";
$obj->aoColumns[$i]->sDefaultContent = "";
$i++;
print'<th class="essential">';
print 'Numéro de série';
print'</th>';
$obj->aoColumns[$i]->mDataProp = "serie";
+ $obj->aoColumns[$i]->sClass = "edit";
$obj->aoColumns[$i]->sDefaultContent = "";
$i++;
print'<th class="essential">';
print 'Emplacement';
print'</th>';
$obj->aoColumns[$i]->mDataProp = "emplacement";
+ $obj->aoColumns[$i]->sClass = "edit";
$obj->aoColumns[$i]->sDefaultContent = "";
$i++;
print'<th class="essential">';
@@ -253,7 +248,7 @@ function() {
],
"success": oConfig.fnAjaxComplete,
"dataType": "json",
- "type": "POST",
+ "type": "POST",
"cache": false,
"error": function () {
alert( "Error detected when sending table data to server" );
@@ -326,63 +321,8 @@ function() {
print'</tbody>';
print'</table>';
-
+$obj->aaSorting = array(array(2, "desc"));
print $object->_datatables($obj,"mouvement",true,true);
-
-
-
-/* init key editable tool */
-print'<script type="text/javascript" charset="utf-8">
- $(document).ready(function() {';
-print'columns = ["operateur","datetime","tracking","codemouv","reference","serie","emplacement","check"];';
-
-print'var keys = new KeyTable( {
- "table": document.getElementById(\'mouvement\'),
- "focus": [ 0, 0 ]
- });
- keys.event.action( null, null, function (nCell) {
- keys.block = true;
-
- var column = keys.fnGetCurrentPosition()[0];
- if(column!=0 && column!=1 && column!=7){
-
- $(nCell).editable( "mouvement.php", {
- "callback": function( sValue ) {
- keys.block = false;
-
- },
- "placeholder" : "",
- "submitdata":function (obj) {
- var posi = oTable.fnGetPosition(nCell);
- var trNodes = oTable.fnGetNodes(posi[0]);
-
- var test = oTable.fnGetData(trNodes);
- var idrow = oTable.fnGetData(posi[0],0);
-
- return {
- "idrow": idrow,
- "column": columns[posi[1]]
- };
-
- },
- "onreset": function(){
- setTimeout( function () {keys.block = false;}, 0);
-
- },
- "onblur": "submit"
- });
- setTimeout( function () {$(nCell).click();}, 0 );
- }
- else keys.block = false;
- });';
-
-/* init default sorting */
-print'oTable.fnSort( [[2,"desc"]]);';
-
-
-print'});';
-print '</script>';
-
print end_box();
print '</div>';

0 comments on commit 6ba73e0

Please sign in to comment.