$ideabox = $('<div id="ideabox_widget"><div class="titre center">Ajouter une idée dans une boîte</div>Boîte : <select id="ideabox_widget_select"></select><br /></div>'); $ideabox.append('Titre : <br /><input id="ideabox_widget_label" type="text" id="ideabox_widget_label" placeholder="Titre de l\'idée" /><br />'); $ideabox.append('Description : <br /><textarea id="ideabox_widget_description" cols="10" rows="2" type="text" placeholder="Description de l\'idée" /><br />'); $ideabox.append('<div class="center" style="margin-top:5px;"><a id="ideabox_widget_valid" class="button" style="cursor:pointer;">Ajouter</a> ' + '<a id="ideabox_widget_cancel" class="button" style="cursor:pointer;">Annuler</a></div>'); $('body').append($ideabox); } var ideabox = new Array(); <?php while ($PDOdb->Get_line()) { echo "ideabox.push({id : '" . $PDOdb->Get_field('rowid') . "', name : '" . addslashes($PDOdb->Get_field('label')) . "'});"; } ?> if(ideabox.length > 0) { openIdeaboxWidget(); $.each(ideabox, function(key, value){ $('#ideabox_widget_select').append('<option value="'+ value.id +'">'+ value.name +'</option>'); }); } $('#ideabox_widget_cancel').click(function(){ $('#ideabox_widget_label').empty(); $('#ideabox_widget_description').empty(); });
$expedition = new Expedition($db); $expedition->fetch($_REQUEST['expedition']); $expedition->fetch_lines(); $TetiquettesVides = array(); $Tetiquettes = array(); //création des div vides for ($i = 0; $i < $nbVides; $i++) { $TetiquettesVides[$i] = array($i); } $TPDOdb = new TPDOdb(); //création des div pleines foreach ($expedition->lines as $ligne) { $TPDOdb->Execute("SELECT rowid FROM " . MAIN_DB_PREFIX . "expeditiondet_asset WHERE fk_expeditiondet = " . $ligne->rowid); $TidExepeditiondetAsset = array(); while ($TPDOdb->Get_line()) { $TidExepeditiondetAsset[] = $TPDOdb->Get_field('rowid'); } foreach ($TidExepeditiondetAsset as $idExpeditiondetAsset) { $sql = "SELECT p.ref, p.label as nom, p.note as descritpion, eda.tare as tare, a.serial_number as code, a.lot_number as lot, eda.weight_reel as poids, eda.weight_reel_unit as poids_unit, eda.tare_unit as tare_unit\n\t\t\t\t\tFROM " . MAIN_DB_PREFIX . "expeditiondet_asset as eda\n\t\t\t\t\t\tLEFT JOIN " . MAIN_DB_PREFIX . "asset as a ON (a.rowid = eda.fk_asset)\n\t\t\t\t\t\tLEFT JOIN " . MAIN_DB_PREFIX . "product as p ON (p.rowid = a.fk_product)\n\t\t\t\t\tWHERE eda.rowid = " . $idExpeditiondetAsset; $TPDOdb->Execute($sql); $TPDOdb->Get_line(); $tare_unit = _unit($TPDOdb->Get_field('tare_unit')); $poids_unit = _unit($TPDOdb->Get_field('poids_unit')); //On duplique l'étiquette autant de fois que demandé en paramètre for ($i = 0; $i < $nbCopies; $i++) { $Tetiquettes[] = array("ref" => $TPDOdb->Get_field('ref'), "nom" => $TPDOdb->Get_field('nom'), "description" => (int) $TPDOdb->Get_field('description') != 0 ? $TPDOdb->Get_field('description') : "", "tare" => number_format($TPDOdb->Get_field('tare'), 2, ',', ' '), "tare_unit" => $tare_unit, "code" => $TPDOdb->Get_field('code'), "lot" => $TPDOdb->Get_field('lot'), "poids" => number_format($TPDOdb->Get_field('poids'), 2, ',', ' '), "poids_unit" => $poids_unit); } } } if (!empty($_REQUEST['margetop'])) { dolibarr_set_const($db, 'ETIQUETTE_MARGE_TOP_' . $modele, $_REQUEST['margetop'], 'chaine', 1, 'Marge en mm');