$text_icon = img_picto('', 'error'); $text_info = $langs->trans('NonShippable') . '<br>' . $text_info; } } print '<td>'; if ($nbprod) { print $form->textwithtooltip('', $text_info, 2, 1, $text_icon, '', 2); } if ($warning) { print $form->textwithtooltip('', $langs->trans('NotEnoughForAllOrders') . '<br>' . $text_warning, 2, 1, img_picto('', 'error'), '', 2); } print '</td>'; } // Warning late icon print '<td class="nobordernopadding nowrap">'; if ($generic_commande->hasDelay()) { print img_picto($langs->trans("Late"), "warning"); } if (!empty($objp->note_private)) { print ' <span class="note">'; print '<a href="' . DOL_URL_ROOT . '/commande/note.php?id=' . $objp->rowid . '">' . img_picto($langs->trans("ViewPrivateNote"), 'object_generic') . '</a>'; print '</span>'; } print '</td>'; print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">'; $filename = dol_sanitizeFileName($objp->ref); $filedir = $conf->commande->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource = $_SERVER['PHP_SELF'] . '?id=' . $objp->rowid; print $formfile->getDocumentsLink($generic_commande->element, $filename, $filedir); print '</td>'; print '</tr></table>';
/** * Load indicators for dashboard (this->nbtodo and this->nbtodolate) * * @param User $user Object user * @return WorkboardResponse|int <0 if KO, WorkboardResponse if OK */ function load_board($user) { global $conf, $user, $langs; $clause = " WHERE"; $sql = "SELECT c.rowid, c.date_creation as datec, c.date_commande, c.date_livraison as delivery_date, c.fk_statut"; $sql .= " FROM " . MAIN_DB_PREFIX . "commande as c"; if (!$user->rights->societe->client->voir && !$user->societe_id) { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe_commerciaux as sc ON c.fk_soc = sc.fk_soc"; $sql .= " WHERE sc.fk_user = "******" AND"; } $sql .= $clause . " c.entity IN (" . getEntity('commande', 1) . ")"; //$sql.= " AND c.fk_statut IN (1,2,3) AND c.facture = 0"; $sql .= " AND ((c.fk_statut IN (" . self::STATUS_VALIDATED . "," . self::STATUS_ACCEPTED . ")) OR (c.fk_statut = " . self::STATUS_CLOSED . " AND c.facture = 0))"; // If status is 2 and facture=1, it must be selected if ($user->societe_id) { $sql .= " AND c.fk_soc = " . $user->societe_id; } $resql = $this->db->query($sql); if ($resql) { $response = new WorkboardResponse(); $response->warning_delay = $conf->commande->client->warning_delay / 60 / 60 / 24; $response->label = $langs->trans("OrdersToProcess"); $response->url = DOL_URL_ROOT . '/commande/list.php?viewstatut=-3'; $response->img = img_object($langs->trans("Orders"), "order"); $generic_commande = new Commande($this->db); while ($obj = $this->db->fetch_object($resql)) { $response->nbtodo++; $generic_commande->statut = $obj->fk_statut; $generic_commande->date_livraison = $obj->delivery_date; if ($generic_commande->hasDelay()) { $response->nbtodolate++; } } return $response; } else { $this->error = $this->db->error(); return -1; } }