print '</td>'; print "</tr>\n"; $var = true; $total = 0; $subtotal = 0; while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); $now = dol_now(); $var = !$var; print '<tr ' . $bc[$var] . '>'; print '<td class="nowrap">'; $objectstatic->id = $objp->propalid; $objectstatic->ref = $objp->ref; print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<td class="nobordernopadding nowrap">'; print $objectstatic->getNomUrl(1); print '</td>'; print '<td style="min-width: 20px" class="nobordernopadding nowrap">'; if ($objp->fk_statut == 1 && $db->jdate($objp->dfv) < $now - $conf->propal->cloture->warning_delay) { print img_warning($langs->trans("Late")); } if (!empty($objp->note_private)) { print ' <span class="note">'; print '<a href="' . DOL_URL_ROOT . '/comm/propal/note.php?id=' . $objp->propalid . '">' . img_picto($langs->trans("ViewPrivateNote"), 'object_generic') . '</a>'; print '</span>'; } print '</td>'; // Ref print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">'; $filename = dol_sanitizeFileName($objp->ref); $filedir = $conf->propal->dir_output . '/' . dol_sanitizeFileName($objp->ref);
{ print '<tr><td>'.$langs->trans("RefOrder").'</td>'; $order=new Commande($db); $order->fetch($expedition->origin_id); print '<td colspan="3">'; print $order->getNomUrl(1,'commande'); print "</td>\n"; print '</tr>'; } if ($typeobject == 'propal' && $expedition->origin_id && $conf->propal->enabled) { $propal=new Propal($db); $propal->fetch($expedition->origin_id); print '<tr><td>'.$langs->trans("RefProposal").'</td>'; print '<td colspan="3">'; print $propal->getNomUrl(1,'expedition'); print "</td>\n"; print '</tr>'; } // Ref client print '<tr><td>'.$langs->trans("RefCustomer").'</td>'; print '<td colspan="3">'.$delivery->ref_customer."</a></td>\n"; print '</tr>'; // Date print '<tr><td>'.$langs->trans("DateCreation").'</td>'; print '<td colspan="3">'.dol_print_date($delivery->date_creation,'daytext')."</td>\n"; print '</tr>'; // Date delivery real / Received
while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); $var=!$var; print "<tr $bc[$var]>"; print '<td nowrap="nowrap">'; $propalstatic->id=$objp->propalid; $propalstatic->ref=$objp->ref; //Ref print '<table class="nobordernopadding"><tr class="nocellnopadd">'; print '<td width="90" class="nobordernopadding" nowrap="nowrap">'; print $propalstatic->getNomUrl(1, '', "&socid=$socid&viewstatut=$viewstatut&sortfield=$sortfield&$sortorder"); print '</td>'; print '<td width="20" class="nobordernopadding" nowrap="nowrap">'; if ($objp->fk_statut == 1 && $db->jdate($objp->dfin) < ($now - $conf->propal->cloture->warning_delay)) print img_warning($langs->trans("Late")); print '</td>'; print '<td width="16" align="right" class="nobordernopadding">'; $filename=dol_sanitizeFileName($objp->ref); $filedir=$conf->propale->dir_output . '/' . dol_sanitizeFileName($objp->ref); $urlsource=$_SERVER['PHP_SELF'].'?id='.$objp->propalid; $formfile->show_documents('propal',$filename,$filedir,$urlsource,'','','',1,'',1); print '</td></tr></table>';
if ($num > 0) { print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print '<td colspan="3">'.$langs->trans("ProposalsDraft").'</td></tr>'; $i = 0; $var=true; while ($i < $num) { $obj = $db->fetch_object($resql); $var=!$var; print '<tr '.$bc[$var].'><td nowrap="nowrap">'; $propalstatic->id=$obj->rowid; $propalstatic->ref=$obj->ref; print $propalstatic->getNomUrl(1); print '</td>'; print '<td nowrap="nowrap">'; $companystatic->id=$obj->socid; $companystatic->name=$obj->name; $companystatic->client=$obj->client; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1,'customer',16); print '</td>'; print '<td align="right" nowrap="nowrap">'.price($obj->total_ht).'</td></tr>'; $i++; $total += $obj->price; } if ($total>0) { $var=!$var;
/** * Load data into info_box_contents array to show array later. * * @param int $max Maximum number of records to load * @return void */ function loadBox($max = 5) { global $user, $langs, $db, $conf; $this->max = $max; include_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; $propalstatic = new Propal($db); $societestatic = new Societe($db); $this->info_box_head = array('text' => $langs->trans("BoxTitleLast" . ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified") . "Propals", $max)); if ($user->rights->propale->lire) { $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client, s.logo,"; $sql .= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.tms"; $sql .= " FROM " . MAIN_DB_PREFIX . "societe as s"; $sql .= ", " . MAIN_DB_PREFIX . "propal as p"; if (!$user->rights->societe->client->voir && !$user->societe_id) { $sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc"; } $sql .= " WHERE p.fk_soc = s.rowid"; $sql .= " AND p.entity = " . $conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) { $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = "******" AND s.rowid = " . $user->societe_id; } if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) { $sql .= " ORDER BY p.datep DESC, p.ref DESC "; } else { $sql .= " ORDER BY p.tms DESC, p.ref DESC "; } $sql .= $db->plimit($max, 0); $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); $now = dol_now(); $line = 0; while ($line < $num) { $objp = $db->fetch_object($result); $date = $db->jdate($objp->dp); $datec = $db->jdate($objp->datec); $datem = $db->jdate($objp->tms); $dateterm = $db->jdate($objp->fin_validite); $dateclose = $db->jdate($objp->date_cloture); $propalstatic->id = $objp->rowid; $propalstatic->ref = $objp->ref; $propalstatic->total_ht = $objp->total_ht; $propalstatic->total_tva = $objp->total_tva; $propalstatic->total_ttc = $objp->total_ttc; $societestatic->id = $objp->socid; $societestatic->name = $objp->name; $societestatic->code_client = $objp->code_client; $societestatic->logo = $objp->logo; $late = ''; if ($objp->fk_statut == 1 && $dateterm < $now - $conf->propal->cloture->warning_delay) { $late = img_warning($langs->trans("Late")); } $this->info_box_contents[$line][] = array('td' => 'align="left"', 'text' => $propalstatic->getNomUrl(1), 'text2' => $late, 'asis' => 1); $this->info_box_contents[$line][] = array('td' => 'align="left"', 'text' => $societestatic->getNomUrl(1, '', 40), 'asis' => 1); $this->info_box_contents[$line][] = array('td' => 'align="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency)); $this->info_box_contents[$line][] = array('td' => 'align="right"', 'text' => dol_print_date($date, 'day')); $this->info_box_contents[$line][] = array('td' => 'align="right" width="18"', 'text' => $propalstatic->LibStatut($objp->fk_statut, 3)); $line++; } if ($num == 0) { $this->info_box_contents[$line][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedProposals")); } $db->free($result); } else { $this->info_box_contents[0][0] = array('td' => 'align="left"', 'maxlength' => 500, 'text' => $db->error() . ' sql=' . $sql); } } else { $this->info_box_contents[0][0] = array('td' => 'align="left"', 'text' => $langs->trans("ReadPermissionNotAllowed")); } }
print '<tr><td>'; $objectsrc = new Commande($db); $objectsrc->fetch($object->{$typeobject}->id); print $langs->trans("RefOrder") . '</td>'; print '<td colspan="3">'; print $objectsrc->getNomUrl(1, 'commande'); print "</td>\n"; print '</tr>'; } if ($typeobject == 'propal' && $object->{$typeobject}->id && !empty($conf->propal->enabled)) { print '<tr><td>'; $objectsrc = new Propal($db); $objectsrc->fetch($object->{$typeobject}->id); print $langs->trans("RefProposal") . '</td>'; print '<td colspan="3">'; print $objectsrc->getNomUrl(1, 'expedition'); print "</td>\n"; print '</tr>'; } // Ref customer print '<tr><td>' . $langs->trans("RefCustomer") . '</td>'; print '<td colspan="3">' . $object->ref_customer . "</a></td>\n"; print '</tr>'; // Date creation print '<tr><td>' . $langs->trans("DateCreation") . '</td>'; print '<td colspan="3">' . dol_print_date($object->date_creation, "day") . "</td>\n"; print '</tr>'; // Delivery date planned print '<tr><td height="10">'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('DateDeliveryPlanned');
if ($resql) { print '<table class="noborder" width="100%">'; print '<tr class="liste_titre">'; print '<td colspan="2">' . $langs->trans("DraftPropals") . '</td></tr>'; $langs->load("propal"); $num = $db->num_rows($resql); if ($num) { $i = 0; $var = True; while ($i < $num) { $var = !$var; $obj = $db->fetch_object($resql); print "<tr {$bc[$var]}>"; $propalstatic->id = $obj->rowid; $propalstatic->ref = $obj->ref; print '<td nowrap="nowrap">' . $propalstatic->getNomUrl(1) . '</td>'; $companystatic->id = $obj->socid; $companystatic->name = $obj->socname; $companystatic->client = $obj->client; $companystatic->canvas = $obj->canvas; print '<td>' . $companystatic->getNomUrl(1, 'customer', 24) . '</td>'; print '</tr>'; $i++; } } print "</table><br>"; } } print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; $max = 5; /*
function enteteexpedition(&$expedition) { global $langs, $db, $user, $hookmanager, $conf; $form = new Form($db); $soc = new Societe($db); $soc->fetch($expedition->socid); if (!empty($expedition->origin)) { $typeobject = $expedition->origin; $origin = $expedition->origin; $expedition->fetch_origin(); } print '<table class="border" width="100%">'; $linkback = '<a href="' . DOL_URL_ROOT . '/expedition/liste.php">' . $langs->trans("BackToList") . '</a>'; // Ref print '<tr><td width="20%">' . $langs->trans("Ref") . '</td>'; print '<td colspan="3">'; print $form->showrefnav($expedition, 'ref', $linkback, 1, 'ref', 'ref'); print '</td></tr>'; // Customer print '<tr><td width="20%">' . $langs->trans("Customer") . '</td>'; print '<td colspan="3">' . $soc->getNomUrl(1) . '</td>'; print "</tr>"; // Linked documents if ($typeobject == 'commande' && $expedition->{$typeobject}->id && !empty($conf->commande->enabled)) { print '<tr><td>'; $objectsrc = new Commande($db); $objectsrc->fetch($expedition->{$typeobject}->id); print $langs->trans("RefOrder") . '</td>'; print '<td colspan="3">'; print $objectsrc->getNomUrl(1, 'commande'); print "</td>\n"; print '</tr>'; } if ($typeobject == 'propal' && $expedition->{$typeobject}->id && !empty($conf->propal->enabled)) { print '<tr><td>'; $objectsrc = new Propal($db); $objectsrc->fetch($expedition->{$typeobject}->id); print $langs->trans("RefProposal") . '</td>'; print '<td colspan="3">'; print $objectsrc->getNomUrl(1, 'expedition'); print "</td>\n"; print '</tr>'; } // Ref customer print '<tr><td>' . $langs->trans("RefCustomer") . '</td>'; print '<td colspan="3">' . $expedition->ref_customer . "</a></td>\n"; print '</tr>'; // Date creation print '<tr><td>' . $langs->trans("DateCreation") . '</td>'; print '<td colspan="3">' . dol_print_date($expedition->date_creation, "day") . "</td>\n"; print '</tr>'; // Delivery date planed print '<tr><td height="10">'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('DateDeliveryPlanned'); print '</td>'; print '</tr></table>'; print '</td><td colspan="2">'; print $expedition->date_delivery ? dol_print_date($expedition->date_delivery, 'dayhourtext') : ' '; print '</td>'; print '</tr>'; // Status print '<tr><td>' . $langs->trans("Status") . '</td>'; print '<td colspan="3">' . $expedition->getLibStatut(4) . "</td>\n"; print '</tr>'; // Sending method print '<tr><td height="10">'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('SendingMethod'); print '</td>'; print '</tr></table>'; print '</td><td colspan="2">'; if ($expedition->shipping_method_id > 0) { // Get code using getLabelFromKey $code = $langs->getLabelFromKey($db, $expedition->shipping_method_id, 'c_shipment_mode', 'rowid', 'code'); print $langs->trans("SendingMethod" . strtoupper($code)); } print '</td>'; print '</tr>'; print "</table>\n"; }
/** * Show html area with actions done * * @param Conf $conf Object conf * @param Translate $langs Object langs * @param DoliDB $db Object db * @param Object $object Object third party or member * @param Contact $objcon Object contact * @param int $noprint Return string but does not output it * @return mixed Return html part or void if noprint is 1 * TODO change function to be able to list event linked to an object. */ function show_actions_done($conf, $langs, $db, $object, $objcon = '', $noprint = 0) { global $bc, $user; // Check parameters if (!is_object($object)) { dol_print_error('', 'BadParameter'); } $out = ''; $histo = array(); $numaction = 0; $now = dol_now('tzuser'); if (!empty($conf->agenda->enabled)) { // Recherche histo sur actioncomm $sql = "SELECT a.id, a.label,"; $sql .= " a.datep as dp,"; $sql .= " a.datep2 as dp2,"; $sql .= " a.note, a.percent,"; $sql .= " a.fk_element, a.elementtype,"; $sql .= " a.fk_user_author, a.fk_contact,"; $sql .= " c.code as acode, c.libelle,"; $sql .= " u.login, u.rowid as user_id"; if (get_class($object) == 'Adherent') { $sql .= ", m.lastname, m.firstname"; } if (get_class($object) == 'Societe') { $sql .= ", sp.lastname, sp.firstname"; } $sql .= " FROM " . MAIN_DB_PREFIX . "c_actioncomm as c, " . MAIN_DB_PREFIX . "user as u, " . MAIN_DB_PREFIX . "actioncomm as a"; if (get_class($object) == 'Adherent') { $sql .= ", " . MAIN_DB_PREFIX . "adherent as m"; } if (get_class($object) == 'Societe') { $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "socpeople as sp ON a.fk_contact = sp.rowid"; } $sql .= " WHERE u.rowid = a.fk_user_author"; $sql .= " AND a.entity IN (" . getEntity('agenda', 1) . ")"; if (get_class($object) == 'Adherent') { $sql .= " AND a.fk_element = m.rowid AND a.elementtype = 'member'"; } if (get_class($object) == 'Adherent' && $object->id) { $sql .= " AND a.fk_element = " . $object->id; } if (get_class($object) == 'Societe' && $object->id) { $sql .= " AND a.fk_soc = " . $object->id; } if (is_object($objcon) && $objcon->id) { $sql .= " AND a.fk_contact = " . $objcon->id; } $sql .= " AND c.id=a.fk_action"; $sql .= " AND (a.percent = 100 OR (a.percent = -1 AND a.datep <= '" . $db->idate($now) . "'))"; $sql .= " ORDER BY a.datep DESC, a.id DESC"; dol_syslog("company.lib::show_actions_done sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $i = 0; $num = $db->num_rows($resql); $var = true; while ($i < $num) { $obj = $db->fetch_object($resql); $histo[$numaction] = array('type' => 'action', 'id' => $obj->id, 'datestart' => $db->jdate($obj->dp), 'date' => $db->jdate($obj->dp2), 'note' => $obj->label, 'percent' => $obj->percent, 'acode' => $obj->acode, 'libelle' => $obj->libelle, 'userid' => $obj->user_id, 'login' => $obj->login, 'contact_id' => $obj->fk_contact, 'lastname' => $obj->lastname, 'firstname' => $obj->firstname, 'fk_element' => $obj->fk_element, 'elementtype' => $obj->elementtype); $numaction++; $i++; } } else { dol_print_error($db); } } if (!empty($conf->mailing->enabled) && !empty($objcon->email)) { $langs->load("mails"); // Recherche histo sur mailing $sql = "SELECT m.rowid as id, mc.date_envoi as da, m.titre as note, '100' as percentage,"; $sql .= " 'AC_EMAILING' as acode,"; $sql .= " u.rowid as user_id, u.login"; // User that valid action $sql .= " FROM " . MAIN_DB_PREFIX . "mailing as m, " . MAIN_DB_PREFIX . "mailing_cibles as mc, " . MAIN_DB_PREFIX . "user as u"; $sql .= " WHERE mc.email = '" . $db->escape($objcon->email) . "'"; // Search is done on email. $sql .= " AND mc.statut = 1"; $sql .= " AND u.rowid = m.fk_user_valid"; $sql .= " AND mc.fk_mailing=m.rowid"; $sql .= " ORDER BY mc.date_envoi DESC, m.rowid DESC"; dol_syslog("company.lib::show_actions_done sql=" . $sql, LOG_DEBUG); $resql = $db->query($sql); if ($resql) { $i = 0; $num = $db->num_rows($resql); $var = true; while ($i < $num) { $obj = $db->fetch_object($resql); $histo[$numaction] = array('type' => 'mailing', 'id' => $obj->id, 'date' => $db->jdate($obj->da), 'note' => $obj->note, 'percent' => $obj->percentage, 'acode' => $obj->acode, 'userid' => $obj->user_id, 'login' => $obj->login); $numaction++; $i++; } $db->free($resql); } else { dol_print_error($db); } } if (!empty($conf->agenda->enabled) || !empty($conf->mailing->enabled) && !empty($objcon->email)) { require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php'; require_once DOL_DOCUMENT_ROOT . '/comm/propal/class/propal.class.php'; require_once DOL_DOCUMENT_ROOT . '/commande/class/commande.class.php'; require_once DOL_DOCUMENT_ROOT . '/compta/facture/class/facture.class.php'; $actionstatic = new ActionComm($db); $userstatic = new User($db); $contactstatic = new Contact($db); // TODO uniformize $propalstatic = new Propal($db); $orderstatic = new Commande($db); $facturestatic = new Facture($db); $out .= "\n"; $out .= '<table class="noborder" width="100%">'; $out .= '<tr class="liste_titre">'; $out .= '<td colspan="2">'; if (get_class($object) == 'Societe') { $out .= '<a href="' . DOL_URL_ROOT . '/comm/action/listactions.php?socid=' . $object->id . '&status=done">'; } $out .= $langs->trans("ActionsDoneShort"); if (get_class($object) == 'Societe') { $out .= '</a>'; } $out .= '</td>'; $out .= '<td colspan="5" align="right">'; $permok = $user->rights->agenda->myactions->create; if ((!empty($object->id) || !empty($objcon->id)) && $permok) { $out .= '<a href="' . DOL_URL_ROOT . '/comm/action/fiche.php?action=create'; if (get_class($object) == 'Societe') { $out .= '&socid=' . $object->id; } $out .= (!empty($objcon->id) ? '&contactid=' . $objcon->id : '') . '&backtopage=1&percentage=-1">'; $out .= $langs->trans("AddAnAction") . ' '; $out .= img_picto($langs->trans("AddAnAction"), 'filenew'); $out .= "</a>"; } $out .= '</td>'; $out .= '</tr>'; foreach ($histo as $key => $value) { $var = !$var; $out .= "<tr " . $bc[$var] . ">"; // Champ date $out .= '<td width="120" class="nowrap">'; if ($histo[$key]['date']) { $out .= dol_print_date($histo[$key]['date'], 'dayhour'); } else { if ($histo[$key]['datestart']) { $out .= dol_print_date($histo[$key]['datestart'], 'dayhour'); } } $out .= "</td>\n"; // Picto $out .= '<td width="16"> </td>'; // Action $out .= '<td>'; if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'action') { $actionstatic->type_code = $histo[$key]['acode']; $transcode = $langs->trans("Action" . $histo[$key]['acode']); $libelle = $transcode != "Action" . $histo[$key]['acode'] ? $transcode : $histo[$key]['libelle']; //$actionstatic->libelle=$libelle; $actionstatic->libelle = $histo[$key]['note']; $actionstatic->id = $histo[$key]['id']; $out .= $actionstatic->getNomUrl(1, 40); } if (isset($histo[$key]['type']) && $histo[$key]['type'] == 'mailing') { $out .= '<a href="' . DOL_URL_ROOT . '/comm/mailing/fiche.php?id=' . $histo[$key]['id'] . '">' . img_object($langs->trans("ShowEMailing"), "email") . ' '; $transcode = $langs->trans("Action" . $histo[$key]['acode']); $libelle = $transcode != "Action" . $histo[$key]['acode'] ? $transcode : 'Send mass mailing'; $out .= dol_trunc($libelle, 40); } $out .= '</td>'; // Title of event //$out.='<td>'.dol_trunc($histo[$key]['note'], 40).'</td>'; // Objet lie // TODO uniformize $out .= '<td>'; if (isset($histo[$key]['elementtype'])) { if ($histo[$key]['elementtype'] == 'propal' && !empty($conf->propal->enabled)) { $propalstatic->ref = $langs->trans("ProposalShort"); $propalstatic->id = $histo[$key]['fk_element']; $out .= $propalstatic->getNomUrl(1); } elseif ($histo[$key]['elementtype'] == 'commande' && !empty($conf->commande->enabled)) { $orderstatic->ref = $langs->trans("Order"); $orderstatic->id = $histo[$key]['fk_element']; $out .= $orderstatic->getNomUrl(1); } elseif ($histo[$key]['elementtype'] == 'facture' && !empty($conf->facture->enabled)) { $facturestatic->ref = $langs->trans("Invoice"); $facturestatic->id = $histo[$key]['fk_element']; $facturestatic->type = $histo[$key]['ftype']; $out .= $facturestatic->getNomUrl(1, 'compta'); } else { $out .= ' '; } } else { $out .= ' '; } $out .= '</td>'; // Contact pour cette action if (!empty($objcon->id) && isset($histo[$key]['contact_id']) && $histo[$key]['contact_id'] > 0) { $contactstatic->lastname = $histo[$key]['lastname']; $contactstatic->firstname = $histo[$key]['firstname']; $contactstatic->id = $histo[$key]['contact_id']; $out .= '<td width="120">' . $contactstatic->getNomUrl(1, '', 10) . '</td>'; } else { $out .= '<td> </td>'; } // Auteur $out .= '<td class="nowrap" width="80">'; $userstatic->id = $histo[$key]['userid']; $userstatic->login = $histo[$key]['login']; $out .= $userstatic->getLoginUrl(1); $out .= '</td>'; // Statut $out .= '<td class="nowrap" width="20">' . $actionstatic->LibStatut($histo[$key]['percent'], 3) . '</td>'; $out .= "</tr>\n"; $i++; } $out .= "</table>\n"; $out .= "<br>\n"; } if ($noprint) { return $out; } else { print $out; } }
} else { if ($type_tag == 'rel') { $res = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "twiiit WHERE comment LIKE '%:" . $db->escape($tag) . "%'"); $PDOdb = new TPDOdb(); while ($obj = $db->fetch_object($res)) { $twiiit = new TTwiiit(); $twiiit->load($PDOdb, $obj->rowid); $Tab[] = array('link' => $twiiit->getNomUrl(), 'text' => $twiiit->getComment()); } } else { if ($type_tag == 'hashtag') { $res = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "propal WHERE ref = '" . $db->escape($tag) . "'"); while ($obj = $db->fetch_object($res)) { $o = new Propal($db); $o->fetch($obj->rowid); $Tab[] = array('link' => $o->getNomUrl(1), 'link0' => $o->getNomUrl(0), 'type' => 'user'); } $res = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "facture WHERE facnumber = '" . $db->escape($tag) . "'"); while ($obj = $db->fetch_object($res)) { $o = new Facture($db); $o->fetch($obj->rowid); $Tab[] = array('link' => $o->getNomUrl(1), 'link0' => $o->getNomUrl(0), 'type' => 'societe'); } $res = $db->query("SELECT rowid FROM " . MAIN_DB_PREFIX . "product WHERE ref = '" . $db->escape($tag) . "'"); while ($obj = $db->fetch_object($res)) { $o = new Product($db); $o->fetch($obj->rowid); $Tab[] = array('link' => $o->getNomUrl(1), 'link0' => $o->getNomUrl(0), 'type' => 'societe'); } } else { }
$langs->load("project"); print '<tr><td valign="top">' . $langs->trans("Project") . '</td><td>'; $numproject = select_projects(!empty($societe->id) ? $societe->id : 0, GETPOST("projectid") ? GETPOST("projectid") : '', 'projectid'); if ($numproject == 0) { print ' <a href="' . DOL_DOCUMENT_ROOT . '/projet/fiche.php?socid=' . $societe->id . '&action=create">' . $langs->trans("AddProject") . '</a>'; } print '</td></tr>'; } // PropalID if (GETPOST("propalid")) { // Object linked $propal = new Propal($db); $propal->fetch(GETPOST("propalid")); print '<tr><td valign="top">' . $langs->trans("LinkedObject") . '</td><td>'; print '<input type="hidden" name="propalid" value="' . $propal->id . '">'; print $propal->getNomUrl(1); print '</td></tr>'; } if (GETPOST("datep") && preg_match('/^([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9])$/', GETPOST("datep"), $reg)) { $actioncomm->datep = dol_mktime(0, 0, 0, $reg[2], $reg[3], $reg[1]); } // Priority print '<tr><td nowrap>' . $langs->trans("Priority") . '</td><td colspan="3">'; print '<input type="text" name="priority" value="' . (GETPOST('priority') ? GETPOST('priority') : ($actioncomm->priority ? $actioncomm->priority : '')) . '" size="5">'; print '</td></tr>'; add_row_for_calendar_link(); // Description print '<tr><td valign="top">' . $langs->trans("Description") . '</td><td>'; require_once DOL_DOCUMENT_ROOT . "/core/class/doleditor.class.php"; $doleditor = new DolEditor('note', GETPOST('note') ? GETPOST('note') : $actioncomm->note, '', 280, 'dolibarr_notes', 'In', true, true, $conf->fckeditor->enabled, ROWS_7, 90); $doleditor->Create();