/** * 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")); } }
$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] . ">"; $supplier_proposalstatic->id = $obj->rowid; $supplier_proposalstatic->ref = $obj->ref; print '<td class="nowrap">' . $supplier_proposalstatic->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 '</div><div class="fichetwothirdright"><div class="ficheaddleft">'; $max = 5; /* * Last modified askprice */ $sql = "SELECT c.rowid, c.ref, c.fk_statut, s.nom as socname, s.rowid as socid, s.canvas, s.client,"; $sql .= " date_cloture as datec"; $sql .= " FROM " . MAIN_DB_PREFIX . "supplier_proposal as c";
} $sql .= " GROUP BY s.nom, s.rowid"; $var = true; $resql = $db->query($sql); if ($resql) { $num = $db->num_rows($resql); $i = 0; while ($i < $num) { $obj = $db->fetch_object($resql); $var = !$var; print "<tr " . $bc[$var] . ">"; print '<td class="nowrap">'; if ($obj->socid) { $socstatic->id = $obj->socid; $socstatic->name = $obj->name; print $socstatic->getNomUrl(1); } else { print $langs->trans("OthersNotLinkedToThirdParty"); } print '</td>'; print '<td align="right"><a href="' . DOL_URL_ROOT . '/projet/list.php?socid=' . $obj->socid . '">' . $obj->nb . '</a></td>'; print "</tr>\n"; $i++; } $db->free($resql); } else { dol_print_error($db); } print "</table>"; print '</div></div></div>'; // Tasks for all resources of all opened projects and time spent for each task/resource
$facturestatic->id=$objp->facid; $facturestatic->ref=$objp->ref; print $facturestatic->getNomUrl(1); print "</td>\n"; print "<td nowrap>".dol_trunc($objp->facnumber,12)."</td>\n"; print "<td nowrap align=\"center\">".dol_print_date($db->jdate($objp->df))."</td>\n"; print "<td nowrap align=\"center\">".dol_print_date($db->jdate($objp->datelimite)); if ($db->jdate($objp->datelimite) < ($now - $conf->facture->fournisseur->warning_delay) && ! $objp->paye && $objp->fk_statut == 1) print img_warning($langs->trans("Late")); print "</td>\n"; print '<td>'; $companystatic->id=$objp->socid; $companystatic->nom=$objp->nom; print $companystatic->getNomUrl(1,'supplier',32); print '</td>'; print "<td align=\"right\">".price($objp->total_ht)."</td>"; print "<td align=\"right\">".price($objp->total_ttc)."</td>"; print "<td align=\"right\">".price($objp->am)."</td>"; // Affiche statut de la facture print '<td align="right" nowrap="nowrap">'; print $facturestatic->LibStatut($objp->paye,$objp->fk_statut,5,$objp->am); print '</td>'; print "</tr>\n"; $total_ht+=$objp->total_ht; $total_ttc+=$objp->total_ttc; $total_paid+=$objp->am;
*/ print '<table class="border" width="100%">'; $linkback = '<a href="' . DOL_URL_ROOT . '/contact/list.php">' . $langs->trans("BackToList") . '</a>'; // Ref print '<tr><td>' . $langs->trans("Ref") . '</td><td colspan="3">'; print $form->showrefnav($contact, 'id', $linkback); print '</td></tr>'; // Name print '<tr><td width="20%">' . $langs->trans("Lastname") . ' / ' . $langs->trans("Label") . '</td><td>' . $contact->lastname . '</td>'; print '<td width="20%">' . $langs->trans("Firstname") . '</td><td width="25%">' . $contact->firstname . '</td></tr>'; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { if ($contact->socid > 0) { $objsoc = new Societe($db); $objsoc->fetch($contact->socid); print '<tr><td width="15%">' . $langs->trans("ThirdParty") . '</td><td colspan="3">' . $objsoc->getNomUrl(1) . '</td></tr>'; } else { print '<tr><td width="15%">' . $langs->trans("ThirdParty") . '</td><td colspan="3">'; print $langs->trans("ContactNotLinkedToCompany"); print '</td></tr>'; } } // Civility print '<tr><td>' . $langs->trans("UserTitle") . '</td><td colspan="3">'; print $contact->getCivilityLabel(); print '</td></tr>'; print '</table>'; print '</div>'; print '<br>'; print $langs->trans("ExportCardToFormat") . ': '; print '<a href="' . DOL_URL_ROOT . '/contact/vcard.php?id=' . $contact->id . '">';
} print ' ' . $langs->trans($reg[1]); } else { print ' ' . $links[$key]['label']; } print '</a>'; } } print '</td>'; // Add third party column print '<td>'; foreach ($links as $key => $val) { if ($links[$key]['type'] == 'company') { $societestatic->id = $links[$key]['url_id']; $societestatic->name = $links[$key]['label']; print $societestatic->getNomUrl(1, '', 16); } else { if ($links[$key]['type'] == 'user') { $userstatic->id = $links[$key]['url_id']; $userstatic->lastname = $links[$key]['label']; print $userstatic->getNomUrl(1, ''); } else { if ($links[$key]['type'] == 'sc') { // sc=old value $chargestatic->id = $links[$key]['url_id']; if (preg_match('/^\\((.*)\\)$/i', $links[$key]['label'], $reg)) { if ($reg[1] == 'socialcontribution') { $reg[1] = 'SocialContribution'; } $chargestatic->lib = $langs->trans($reg[1]); } else {
print "</tr>\n"; $societestatic = new Societe($db); if ($num) { $i = 0; $total = $total_ttc = $totalam = 0; while ($i < $num) { $obj = $db->fetch_object($resql); print '<tr ' . $bc[$var] . '><td>'; $facstatic->ref = $obj->ref; $facstatic->id = $obj->rowid; print $facstatic->getNomUrl(1, ''); print '</td>'; $societestatic->id = $obj->socid; $societestatic->nom = $obj->nom; $societestatic->client = 0; print '<td>' . $societestatic->getNomUrl(1, 'supplier', 44) . '</td>'; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) { print '<td align="right">' . price($obj->total_ht) . '</td>'; } print '<td align="right">' . price($obj->total_ttc) . '</td>'; print '<td align="right">' . price($obj->am) . '</td>'; print '<td>' . $facstatic->LibStatut($obj->paye, $obj->fk_statut, 3) . '</td>'; print '</tr>'; $total += $obj->total_ht; $total_ttc += $obj->total_ttc; $totalam += $obj->am; $i++; $var = !$var; } print '<tr class="liste_total"><td colspan="2">' . $langs->trans("Total") . ' <font style="font-weight: normal">(' . $langs->trans("RemainderToPay") . ': ' . price($total_ttc - $totalam) . ')</font> </td>'; if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
$pv = $objp->selling_price; $marge = $objp->marge; if ($marge < 0) { $marginRate = $pa != 0 ? -1 * (100 * $marge / $pa) : ''; $markRate = $pv != 0 ? -1 * (100 * $marge / $pv) : ''; } else { $marginRate = $pa != 0 ? 100 * $marge / $pa : ''; $markRate = $pv != 0 ? 100 * $marge / $pv : ''; } $var = !$var; print "<tr " . $bc[$var] . ">"; if ($agentid > 0) { $companystatic->id = $objp->socid; $companystatic->nom = $objp->nom; $companystatic->client = $objp->client; print "<td>" . $companystatic->getNomUrl(1, 'customer') . "</td>\n"; } else { $userstatic->fetch($objp->agent); print "<td>" . $userstatic->getFullName($langs, 0, 0, 0) . "</td>\n"; } print "<td align=\"right\">" . price($pv, null, null, null, null, $rounding) . "</td>\n"; print "<td align=\"right\">" . price($pa, null, null, null, null, $rounding) . "</td>\n"; print "<td align=\"right\">" . price($marge, null, null, null, null, $rounding) . "</td>\n"; if (!empty($conf->global->DISPLAY_MARGIN_RATES)) { print "<td align=\"right\">" . ($marginRate === '' ? 'n/a' : price($marginRate, null, null, null, null, $rounding) . "%") . "</td>\n"; } if (!empty($conf->global->DISPLAY_MARK_RATES)) { print "<td align=\"right\">" . ($markRate === '' ? 'n/a' : price($markRate, null, null, null, null, $rounding) . "%") . "</td>\n"; } print "</tr>\n"; $i++;
* Fiche en mode visu */ print '<table class="border" width="100%">'; // Ref print '<tr><td width="20%">' . $langs->trans("Ref") . '</td><td colspan="3">'; print $form->showrefnav($object, 'id'); print '</td></tr>'; // Name print '<tr><td width="20%">' . $langs->trans("Lastname") . ' / ' . $langs->trans("Label") . '</td><td width="30%">' . $object->lastname . '</td>'; print '<td width="20%">' . $langs->trans("Firstname") . '</td><td width="30%">' . $object->firstname . '</td></tr>'; // Company if (empty($conf->global->SOCIETE_DISABLE_CONTACTS)) { if ($object->socid > 0) { $objsoc = new Societe($db); $objsoc->fetch($object->socid); print '<tr><td>' . $langs->trans("Company") . '</td><td colspan="3">' . $objsoc->getNomUrl(1) . '</td></tr>'; } else { print '<tr><td>' . $langs->trans("Company") . '</td><td colspan="3">'; print $langs->trans("ContactNotLinkedToCompany"); print '</td></tr>'; } } // Civility print '<tr><td>' . $langs->trans("UserTitle") . '</td><td colspan="3">'; print $object->getCivilityLabel(); print '</td></tr>'; // Date To Birth print '<tr>'; if (!empty($object->birthday)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php'; print '<td>' . $langs->trans("DateToBirth") . '</td><td colspan="3">' . dol_print_date($object->birthday, "day");
/** * Get the form to input an email * this->withfile: 0=No attaches files, 1=Show attached files, 2=Can add new attached files * * @param string $addfileaction Name of action when posting file attachments * @param string $removefileaction Name of action when removing file attachments * @return string Form to show */ function get_form($addfileaction = 'addfile', $removefileaction = 'removefile') { global $conf, $langs, $user, $hookmanager, $form; if (!is_object($form)) { $form = new Form($this->db); } $langs->load("other"); $langs->load("mails"); $hookmanager->initHooks(array('formmail')); $parameters = array('addfileaction' => $addfileaction, 'removefileaction' => $removefileaction); $reshook = $hookmanager->executeHooks('getFormMail', $parameters, $this); if (!empty($reshook)) { return $hookmanager->resPrint; } else { $out = ''; // Define list of attached files $listofpaths = array(); $listofnames = array(); $listofmimes = array(); if (!empty($_SESSION["listofpaths"])) { $listofpaths = explode(';', $_SESSION["listofpaths"]); } if (!empty($_SESSION["listofnames"])) { $listofnames = explode(';', $_SESSION["listofnames"]); } if (!empty($_SESSION["listofmimes"])) { $listofmimes = explode(';', $_SESSION["listofmimes"]); } $out .= "\n<!-- Debut form mail -->\n"; if ($this->withform == 1) { $out .= '<form method="POST" name="mailform" enctype="multipart/form-data" action="' . $this->param["returnurl"] . '">' . "\n"; $out .= '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '" />'; } foreach ($this->param as $key => $value) { $out .= '<input type="hidden" id="' . $key . '" name="' . $key . '" value="' . $value . '" />' . "\n"; } $out .= '<table class="border" width="100%">' . "\n"; // Substitution array if (!empty($this->withsubstit)) { $out .= '<tr><td colspan="2">'; $help = ""; foreach ($this->substit as $key => $val) { $help .= $key . ' -> ' . $langs->trans($val) . '<br>'; } $out .= $form->textwithpicto($langs->trans("EMailTestSubstitutionReplacedByGenericValues"), $help); $out .= "</td></tr>\n"; } // From if (!empty($this->withfrom)) { if (!empty($this->withfromreadonly)) { $out .= '<input type="hidden" id="fromname" name="fromname" value="' . $this->fromname . '" />'; $out .= '<input type="hidden" id="frommail" name="frommail" value="' . $this->frommail . '" />'; $out .= '<tr><td width="180">' . $langs->trans("MailFrom") . '</td><td>'; if ($this->fromtype == 'user' && $this->fromid > 0) { $langs->load("users"); $fuser = new User($this->db); $fuser->fetch($this->fromid); $out .= $fuser->getNomUrl(1); } else { $out .= $this->fromname; } if ($this->frommail) { $out .= " <" . $this->frommail . ">"; } else { if ($this->fromtype) { $langs->load("errors"); $out .= '<font class="warning"> <' . $langs->trans("ErrorNoMailDefinedForThisUser") . '> </font>'; } } $out .= "</td></tr>\n"; $out .= "</td></tr>\n"; } else { $out .= "<tr><td>" . $langs->trans("MailFrom") . "</td><td>"; $out .= $langs->trans("Name") . ':<input type="text" id="fromname" name="fromname" size="32" value="' . $this->fromname . '" />'; $out .= ' '; $out .= $langs->trans("EMail") . ':<<input type="text" id="frommail" name="frommail" size="32" value="' . $this->frommail . '" />>'; $out .= "</td></tr>\n"; } } // Replyto if (!empty($this->withreplyto)) { if ($this->withreplytoreadonly) { $out .= '<input type="hidden" id="replyname" name="replyname" value="' . $this->replytoname . '" />'; $out .= '<input type="hidden" id="replymail" name="replymail" value="' . $this->replytomail . '" />'; $out .= "<tr><td>" . $langs->trans("MailReply") . "</td><td>" . $this->replytoname . ($this->replytomail ? " <" . $this->replytomail . ">" : ""); $out .= "</td></tr>\n"; } } // Errorsto if (!empty($this->witherrorsto)) { //if (! $this->errorstomail) $this->errorstomail=$this->frommail; $errorstomail = !empty($conf->global->MAIN_MAIL_ERRORS_TO) ? $conf->global->MAIN_MAIL_ERRORS_TO : $this->errorstomail; if ($this->witherrorstoreadonly) { $out .= '<input type="hidden" id="errorstomail" name="errorstomail" value="' . $errorstomail . '" />'; $out .= '<tr><td>' . $langs->trans("MailErrorsTo") . '</td><td>'; $out .= $errorstomail; $out .= "</td></tr>\n"; } else { $out .= '<tr><td>' . $langs->trans("MailErrorsTo") . '</td><td>'; $out .= '<input size="30" id="errorstomail" name="errorstomail" value="' . $errorstomail . '" />'; $out .= "</td></tr>\n"; } } // To if (!empty($this->withto) || is_array($this->withto)) { $out .= '<tr><td width="180">'; if ($this->withtofree) { $out .= $form->textwithpicto($langs->trans("MailTo"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); } else { $out .= $langs->trans("MailTo"); } $out .= '</td><td>'; if ($this->withtoreadonly) { if (!empty($this->toname) && !empty($this->tomail)) { $out .= '<input type="hidden" id="toname" name="toname" value="' . $this->toname . '" />'; $out .= '<input type="hidden" id="tomail" name="tomail" value="' . $this->tomail . '" />'; if ($this->totype == 'thirdparty') { $soc = new Societe($this->db); $soc->fetch($this->toid); $out .= $soc->getNomUrl(1); } else { if ($this->totype == 'contact') { $contact = new Contact($this->db); $contact->fetch($this->toid); $out .= $contact->getNomUrl(1); } else { $out .= $this->toname; } } $out .= ' <' . $this->tomail . '>'; if ($this->withtofree) { $out .= '<br>' . $langs->trans("or") . ' <input size="' . (is_array($this->withto) ? "30" : "60") . '" id="sendto" name="sendto" value="' . (!is_array($this->withto) && !is_numeric($this->withto) ? isset($_REQUEST["sendto"]) ? $_REQUEST["sendto"] : $this->withto : "") . '" />'; } } else { $out .= !is_array($this->withto) && !is_numeric($this->withto) ? $this->withto : ""; } } else { if (!empty($this->withtofree)) { $out .= '<input size="' . (is_array($this->withto) ? "30" : "60") . '" id="sendto" name="sendto" value="' . (!is_array($this->withto) && !is_numeric($this->withto) ? isset($_REQUEST["sendto"]) ? $_REQUEST["sendto"] : $this->withto : "") . '" />'; } if (!empty($this->withto) && is_array($this->withto)) { if (!empty($this->withtofree)) { $out .= " " . $langs->trans("or") . " "; } $out .= $form->selectarray("receiver", $this->withto, GETPOST("receiver"), 1); } if (isset($this->withtosocid) && $this->withtosocid > 0) { $liste = array(); $soc = new Societe($this->db); $soc->fetch($this->withtosocid); foreach ($soc->thirdparty_and_contact_email_array(1) as $key => $value) { $liste[$key] = $value; } if ($this->withtofree) { $out .= " " . $langs->trans("or") . " "; } $out .= $form->selectarray("receiver", $liste, GETPOST("receiver"), 1); } } $out .= "</td></tr>\n"; } // CC if (!empty($this->withtocc) || is_array($this->withtocc)) { $out .= '<tr><td width="180">'; $out .= $form->textwithpicto($langs->trans("MailCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); $out .= '</td><td>'; if ($this->withtoccreadonly) { $out .= !is_array($this->withtocc) && !is_numeric($this->withtocc) ? $this->withtocc : ""; } else { $out .= '<input size="' . (is_array($this->withtocc) ? "30" : "60") . '" id="sendtocc" name="sendtocc" value="' . (!is_array($this->withtocc) && !is_numeric($this->withtocc) ? isset($_POST["sendtocc"]) ? $_POST["sendtocc"] : $this->withtocc : (isset($_POST["sendtocc"]) ? $_POST["sendtocc"] : "")) . '" />'; if (!empty($this->withtocc) && is_array($this->withtocc)) { $out .= " " . $langs->trans("or") . " "; $out .= $form->selectarray("receivercc", $this->withtocc, GETPOST("receivercc"), 1); } } $out .= "</td></tr>\n"; } // CCC if (!empty($this->withtoccc) || is_array($this->withtoccc)) { $out .= '<tr><td width="180">'; $out .= $form->textwithpicto($langs->trans("MailCCC"), $langs->trans("YouCanUseCommaSeparatorForSeveralRecipients")); $out .= '</td><td>'; if (!empty($this->withtocccreadonly)) { $out .= !is_array($this->withtoccc) && !is_numeric($this->withtoccc) ? $this->withtoccc : ""; } else { $out .= '<input size="' . (is_array($this->withtoccc) ? "30" : "60") . '" id="sendtoccc" name="sendtoccc" value="' . (!is_array($this->withtoccc) && !is_numeric($this->withtoccc) ? isset($_POST["sendtoccc"]) ? $_POST["sendtoccc"] : $this->withtoccc : (isset($_POST["sendtoccc"]) ? $_POST["sendtoccc"] : "")) . '" />'; if (!empty($this->withtoccc) && is_array($this->withtoccc)) { $out .= " " . $langs->trans("or") . " "; $out .= $form->selectarray("receiverccc", $this->withtoccc, GETPOST("receiverccc"), 1); } } //if (! empty($conf->global->MAIN_MAIL_AUTOCOPY_TO)) print ' '.info_admin("+ ".$conf->global->MAIN_MAIL_AUTOCOPY_TO,1); $out .= "</td></tr>\n"; } // Ask delivery receipt if (!empty($this->withdeliveryreceipt)) { $out .= '<tr><td width="180">' . $langs->trans("DeliveryReceipt") . '</td><td>'; if (!empty($this->withdeliveryreceiptreadonly)) { $out .= yn($this->withdeliveryreceipt); } else { $out .= $form->selectyesno('deliveryreceipt', isset($_POST["deliveryreceipt"]) ? $_POST["deliveryreceipt"] : 0, 1); } $out .= "</td></tr>\n"; } // Topic if (!empty($this->withtopic)) { $this->withtopic = make_substitutions($this->withtopic, $this->substit); $out .= '<tr>'; $out .= '<td width="180">' . $langs->trans("MailTopic") . '</td>'; $out .= '<td>'; if ($this->withtopicreadonly) { $out .= $this->withtopic; $out .= '<input type="hidden" size="60" id="subject" name="subject" value="' . $this->withtopic . '" />'; } else { $out .= '<input type="text" size="60" id="subject" name="subject" value="' . (isset($_POST["subject"]) ? $_POST["subject"] : (is_numeric($this->withtopic) ? '' : $this->withtopic)) . '" />'; } $out .= "</td></tr>\n"; } // Attached files if (!empty($this->withfile)) { $out .= '<tr>'; $out .= '<td width="180">' . $langs->trans("MailFile") . '</td>'; $out .= '<td>'; if (is_numeric($this->withfile)) { // TODO Trick to have param removedfile containing nb of image to delete. But this does not works without javascript $out .= '<input type="hidden" class="removedfilehidden" name="removedfile" value="">' . "\n"; $out .= '<script type="text/javascript" language="javascript">'; $out .= 'jQuery(document).ready(function () {'; $out .= ' jQuery(".removedfile").click(function() {'; $out .= ' jQuery(".removedfilehidden").val(jQuery(this).val());'; $out .= ' });'; $out .= '})'; $out .= '</script>' . "\n"; if (count($listofpaths)) { foreach ($listofpaths as $key => $val) { $out .= '<div id="attachfile_' . $key . '">'; $out .= img_mime($listofnames[$key]) . ' ' . $listofnames[$key]; if (!$this->withfilereadonly) { $out .= ' <input type="image" style="border: 0px;" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/delete.png" value="' . ($key + 1) . '" class="removedfile" id="removedfile_' . $key . '" name="removedfile_' . $key . '" />'; //$out.= ' <a href="'.$_SERVER["PHP_SELF"].'?removedfile='.($key+1).' id="removedfile_'.$key.'">'.img_delete($langs->trans("Delete").'</a>'; } $out .= '<br></div>'; } } else { $out .= $langs->trans("NoAttachedFiles") . '<br>'; } if ($this->withfile == 2) { $out .= '<input type="file" class="flat" id="addedfile" name="addedfile" value="' . $langs->trans("Upload") . '" />'; $out .= ' '; $out .= '<input type="submit" class="button" id="' . $addfileaction . '" name="' . $addfileaction . '" value="' . $langs->trans("MailingAddFile") . '" />'; } } else { $out .= $this->withfile; } $out .= "</td></tr>\n"; } // Message if (!empty($this->withbody)) { $defaultmessage = ""; // TODO A partir du type, proposer liste de messages dans table llx_c_email_template if ($this->param["models"] == 'facture_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendInvoice"); } elseif ($this->param["models"] == 'facture_relance') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendInvoiceReminder"); } elseif ($this->param["models"] == 'propal_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendProposal"); } elseif ($this->param["models"] == 'order_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendOrder"); } elseif ($this->param["models"] == 'order_supplier_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendSupplierOrder"); } elseif ($this->param["models"] == 'invoice_supplier_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendSupplierInvoice"); } elseif ($this->param["models"] == 'shipping_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendShipping"); } elseif ($this->param["models"] == 'fichinter_send') { $defaultmessage = $langs->transnoentities("PredefinedMailContentSendFichInter"); } elseif ($this->param["models"] == 'thirdparty') { $defaultmessage = $langs->transnoentities("PredefinedMailContentThirdparty"); } elseif (!is_numeric($this->withbody)) { $defaultmessage = $this->withbody; } // Complete substitution array if (!empty($conf->paypal->enabled) && !empty($conf->global->PAYPAL_ADD_PAYMENT_URL)) { require_once DOL_DOCUMENT_ROOT . '/paypal/lib/paypal.lib.php'; $langs->load('paypal'); if ($this->param["models"] == 'order_send') { $url = getPaypalPaymentUrl(0, 'order', $this->substit['__ORDERREF__']); $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url)); } if ($this->param["models"] == 'facture_send') { $url = getPaypalPaymentUrl(0, 'invoice', $this->substit['__FACREF__']); $this->substit['__PERSONALIZED__'] = str_replace('\\n', "\n", $langs->transnoentitiesnoconv("PredefinedMailContentLink", $url)); } } $defaultmessage = str_replace('\\n', "\n", $defaultmessage); // Deal with format differences between message and signature (text / HTML) if (dol_textishtml($defaultmessage) && !dol_textishtml($this->substit['__SIGNATURE__'])) { $this->substit['__SIGNATURE__'] = dol_nl2br($this->substit['__SIGNATURE__']); } else { if (!dol_textishtml($defaultmessage) && dol_textishtml($this->substit['__SIGNATURE__'])) { $defaultmessage = dol_nl2br($defaultmessage); } } if (isset($_POST["message"])) { $defaultmessage = $_POST["message"]; } else { $defaultmessage = make_substitutions($defaultmessage, $this->substit); // Clean first \n and br (to avoid empty line when CONTACTCIVNAME is empty) $defaultmessage = preg_replace("/^(<br>)+/", "", $defaultmessage); $defaultmessage = preg_replace("/^\n+/", "", $defaultmessage); } $out .= '<tr>'; $out .= '<td width="180" valign="top">' . $langs->trans("MailText") . '</td>'; $out .= '<td>'; if ($this->withbodyreadonly) { $out .= nl2br($defaultmessage); $out .= '<input type="hidden" id="message" name="message" value="' . $defaultmessage . '" />'; } else { if (!isset($this->ckeditortoolbar)) { $this->ckeditortoolbar = 'dolibarr_notes'; } // Editor wysiwyg require_once DOL_DOCUMENT_ROOT . '/core/class/doleditor.class.php'; if ($this->withfckeditor == -1) { if (!empty($conf->global->FCKEDITOR_ENABLE_MAIL)) { $this->withfckeditor = 1; } else { $this->withfckeditor = 0; } } $doleditor = new DolEditor('message', $defaultmessage, '', 280, $this->ckeditortoolbar, 'In', true, true, $this->withfckeditor, 8, 72); $out .= $doleditor->Create(1); } $out .= "</td></tr>\n"; } if ($this->withform == 1 || $this->withform == -1) { $out .= '<tr><td align="center" colspan="2"><center>'; $out .= '<input class="button" type="submit" id="sendmail" name="sendmail" value="' . $langs->trans("SendMail") . '"'; // Add a javascript test to avoid to forget to submit file before sending email if ($this->withfile == 2 && $conf->use_javascript_ajax) { $out .= ' onClick="if (document.mailform.addedfile.value != \'\') { alert(\'' . dol_escape_js($langs->trans("FileWasNotUploaded")) . '\'); return false; } else { return true; }"'; } $out .= ' />'; if ($this->withcancel) { $out .= ' '; $out .= '<input class="button" type="submit" id="cancel" name="cancel" value="' . $langs->trans("Cancel") . '" />'; } $out .= '</center></td></tr>' . "\n"; } $out .= '</table>' . "\n"; if ($this->withform == 1) { $out .= '</form>' . "\n"; } $out .= "<!-- Fin form mail -->\n"; return $out; } }
$total = 0; $i = 0; while ($i < min($num, $limit)) { $objp = $db->fetch_object($result); $var = !$var; print "<tr " . $bc[$var] . ">"; print "<td>"; $interventionstatic->id = $objp->fichid; $interventionstatic->ref = $objp->ref; print $interventionstatic->getNomUrl(1); print "</td>\n"; print '<td>'; $companystatic->name = $objp->name; $companystatic->id = $objp->socid; $companystatic->client = $objp->client; print $companystatic->getNomUrl(1, '', 44); print '</td>'; print '<td>' . dol_htmlentitiesbr(dol_trunc($objp->description, 20)) . '</td>'; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) { print '<td>' . dol_htmlentitiesbr(dol_trunc($objp->descriptiondetail, 20)) . '</td>'; print '<td align="center">' . dol_print_date($db->jdate($objp->dp), 'dayhour') . "</td>\n"; print '<td align="right">' . convertSecondToTime($objp->duree) . '</td>'; } print '<td align="right">' . $interventionstatic->LibStatut($objp->fk_statut, 5) . '</td>'; print '<td> </td>'; print "</tr>\n"; $total += $objp->duree; $i++; } $rowspan = 3; if (empty($conf->global->FICHINTER_DISABLE_DETAILS)) {
setEventMessages($langs->trans("DefinitionOfBarCodeForProductNotComplete", $producttmp->getNomUrl()), null, 'warnings'); } } } if (GETPOST('submitthirdparty') && GETPOST('submitthirdparty')) { $action = ''; // We reset because we don't want to build doc if (GETPOST('socid') > 0) { $thirdpartytmp->fetch(GETPOST('socid')); $forbarcode = $thirdpartytmp->barcode; $fk_barcode_type = $thirdpartytmp->barcode_type_code; if (empty($fk_barcode_type) && !empty($conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY)) { $fk_barcode_type = $conf->global->GENBARCODE_BARCODETYPE_THIRDPARTY; } if (empty($forbarcode) || empty($fk_barcode_type)) { setEventMessages($langs->trans("DefinitionOfBarCodeForThirdpartyNotComplete", $thirdpartytmp->getNomUrl()), null, 'warnings'); } } } if ($action == 'builddoc') { $result = 0; $error = 0; if (empty($forbarcode)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeValue")), null, 'errors'); $error++; } if (empty($fk_barcode_type)) { setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("BarcodeType")), null, 'errors'); $error++; } if (!$error) {
if ($origin == 'commande') { print $langs->trans('RefCustomerOrder'); } else { if ($origin == 'propal') { print $langs->trans('RefCustomerOrder'); } else { print $langs->trans('RefCustomer'); } } print '</td><td colspan="3">'; print $object->ref_client; print '</td>'; print '</tr>'; // Tiers print '<tr><td class="fieldrequired">' . $langs->trans('Company') . '</td>'; print '<td colspan="3">' . $soc->getNomUrl(1) . '</td>'; print '</tr>'; // Date delivery planned print '<tr><td>' . $langs->trans("DateDeliveryPlanned") . '</td>'; print '<td colspan="3">'; //print dol_print_date($object->date_livraison,"day"); // date_livraison come from order and will be stored into date_delivery planed. $date_delivery = $date_delivery ? $date_delivery : $object->date_livraison; // $date_delivery comes from GETPOST print $form->select_date($date_delivery ? $date_delivery : -1, 'date_delivery', 1, 1, 1); print "</td>\n"; print '</tr>'; // Note Public print '<tr><td>' . $langs->trans("NotePublic") . '</td>'; print '<td colspan="3">'; $doleditor = new DolEditor('note_public', $object->note_public, '', 80, 'dolibarr_notes', 'In', 0, false, true, ROWS_3, 70); print $doleditor->Create(1);
function get_format_libelle_societe($fk_soc) { global $db; if ($fk_soc > 0) { $societe = new Societe($db); $societe->fetch($fk_soc); $url = $societe->getNomUrl(1); return $url; } return ''; }
if (!empty($conf->multicompany->enabled) && $obj->admin && !$obj->entity) { print img_picto($langs->trans("SuperAdministrator"), 'redstar'); } else { if ($obj->admin) { print img_picto($langs->trans("Administrator"), 'star'); } } print "</td>"; print '<td align="left">' . $obj->login . '</td>'; print "<td>"; if ($obj->fk_soc) { $companystatic->id = $obj->fk_soc; $companystatic->name = $obj->name; $companystatic->code_client = $obj->code_client; $companystatic->canvas = $obj->canvas; print $companystatic->getNomUrl(1); } else { print $langs->trans("InternalUser"); } if ($obj->ldap_sid) { print ' (' . $langs->trans("DomainUser") . ')'; } $entity = $obj->entity; $entitystring = ''; // TODO Set of entitystring should be done with a hook if (!empty($conf->multicompany->enabled) && is_object($mc)) { if (empty($entity)) { $entitystring = $langs->trans("AllEntities"); } else { $mc->getInfo($entity); $entitystring = $mc->label;
// Ref client print '<tr><td>'; print '<table class="nobordernopadding" width="100%"><tr><td nowrap>'; print $langs->trans('RefCustomer').'</td><td align="left">'; print '</td>'; if ($_GET['action'] != 'refclient' && $object->brouillon) print '<td align="right"><a href="'.$_SERVER['PHP_SELF'].'?action=refclient&id='.$object->id.'">'.img_edit($langs->trans('Modify')).'</a></td>'; print '</tr></table>'; print '</td><td colspan="5">'; print $object->ref_client; print '</td>'; print '</tr>'; $rowspan=8; // Company print '<tr><td>'.$langs->trans('Company').'</td><td colspan="5">'.$societe->getNomUrl(1).'</td></tr>'; // Ligne info remises tiers print '<tr><td>'.$langs->trans('Discounts').'</td><td colspan="5">'; if ($societe->remise_client) print $langs->trans("CompanyHasRelativeDiscount",$societe->remise_client); else print $langs->trans("CompanyHasNoRelativeDiscount"); $absolute_discount=$societe->getAvailableDiscounts(); print '. '; if ($absolute_discount) print $langs->trans("CompanyHasAbsoluteDiscount",price($absolute_discount),$langs->trans("Currency".$conf->monnaie)); else print $langs->trans("CompanyHasNoAbsoluteDiscount"); print '.'; print '</td></tr>'; // Dates print '<tr><td>'.$langs->trans('Date').'</td><td colspan="3">'; print dol_print_date($object->date,'daytext');
$objp = $db->fetch_object($result); $var = !$var; print "<tr " . $bc[$var] . ">"; // Name print '<td class="nowrap">'; $thirdparty_static->id = $objp->rowid; $thirdparty_static->name = $objp->name; $thirdparty_static->client = $objp->client; $thirdparty_static->fournisseur = $objp->fournisseur; $thirdparty_static->logo = $objp->logo; $thirdparty_static->datem = $db->jdate($objp->datem); $thirdparty_static->status = $objp->status; $thirdparty_static->code_client = $objp->code_client; $thirdparty_static->code_fournisseur = $objp->code_fournisseur; $thirdparty_static->canvas = $objp->canvas; print $thirdparty_static->getNomUrl(1); print "</td>\n"; // Type print '<td align="center">'; if ($thirdparty_static->client == 1 || $thirdparty_static->client == 3) { $thirdparty_static->name = $langs->trans("Customer"); print $thirdparty_static->getNomUrl(0, 'customer', 0, 1); } if ($thirdparty_static->client == 3 && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { print " / "; } if (($thirdparty_static->client == 2 || $thirdparty_static->client == 3) && empty($conf->global->SOCIETE_DISABLE_PROSPECTS)) { $thirdparty_static->name = $langs->trans("Prospect"); print $thirdparty_static->getNomUrl(0, 'prospect', 0, 1); } if (!empty($conf->fournisseur->enabled) && $thirdparty_static->fournisseur) {
$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; print '<tr class="liste_total"><td>'.$langs->trans("Total").'</td><td colspan="2" align="right">'.price($total)."</td></tr>"; } print "</table><br>"; } $db->free($resql); } else
print '<tr><td>'; print '<table width="100%" class="nobordernopadding"><tr><td>'; print $langs->trans('ParentCompany'); print '<td><td align="right">'; if ($user->rights->societe->creer) print '<a href="'.DOL_URL_ROOT.'/societe/lien.php?socid='.$object->id.'">'.img_edit() .'</a>'; else print ' '; print '</td></tr></table>'; print '</td>'; print '<td colspan="3">'; if ($object->parent) { $socm = new Societe($db); $socm->load($object->parent); print $socm->getNomUrl(1).' '.($socm->code_client?"(".$socm->code_client.")":""); print $socm->town?' - '.$socm->town:''; } else { print $langs->trans("NoParentCompany"); } print '</td></tr>'; } // Sales representative include(DOL_DOCUMENT_ROOT.'/societe/tpl/linesalesrepresentative.tpl.php'); // Module Adherent if ($conf->adherent->enabled) { $langs->load("members");
$invoice = new Facture($db); $invoice->fetch($objp->facid); $paiement = $invoice->getSommePaiement(); $creditnotes = $invoice->getSumCreditNotesUsed(); $deposits = $invoice->getSumDepositsUsed(); $alreadypayed = price2num($paiement + $creditnotes + $deposits, 'MT'); $remaintopay = price2num($invoice->total_ttc - $paiement - $creditnotes - $deposits, 'MT'); // Invoice print '<td>'; print $invoice->getNomUrl(1); print "</td>\n"; // Third party print '<td>'; $thirdpartystatic->id = $objp->socid; $thirdpartystatic->name = $objp->name; print $thirdpartystatic->getNomUrl(1); print '</td>'; // Expected to pay print '<td align="right">' . price($objp->total_ttc) . '</td>'; // Amount payed print '<td align="right">' . price($objp->amount) . '</td>'; // Remain to pay print '<td align="right">' . price($remaintopay) . '</td>'; // Status print '<td align="right">' . $invoice->getLibStatut(5, $alreadypayed) . '</td>'; print "</tr>\n"; if ($objp->paye == 1) { $disable_delete = 1; } $total = $total + $objp->amount; $i++;
* * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php'; include_once DOL_DOCUMENT_ROOT . '/compta/bank/class/account.class.php'; include_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php'; if (!empty($_SESSION["CASHDESK_ID_THIRDPARTY"])) { $company = new Societe($db); $company->fetch($_SESSION["CASHDESK_ID_THIRDPARTY"]); $companyLink = $company->getNomUrl(1); } if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"])) { $bankcash = new Account($db); $bankcash->fetch($_SESSION["CASHDESK_ID_BANKACCOUNT_CASH"]); $bankcash->label = $bankcash->ref; $bankcashLink = $bankcash->getNomUrl(1); } if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"])) { $bankcb = new Account($db); $bankcb->fetch($_SESSION["CASHDESK_ID_BANKACCOUNT_CB"]); $bankcbLink = $bankcb->getNomUrl(1); } if (!empty($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"])) { $bankcheque = new Account($db); $bankcheque->fetch($_SESSION["CASHDESK_ID_BANKACCOUNT_CHEQUE"]);
$refcomp = ''; //$obj = $db->fetch_object($result); $obj = array_shift($tab_sqlobj); if ($obj->family == 'invoice_supplier') { $showline = 1; // Uncomment this line to avoid to count suppliers credit note (ff.type = 2) //$showline=(($obj->total_ttc < 0 && $obj->type != 2) || ($obj->total_ttc > 0 && $obj->type == 2)) if ($showline) { $ref = $obj->ref; $facturefournstatic->ref = $ref; $facturefournstatic->id = $obj->objid; $facturefournstatic->type = $obj->type; $ref = $facturefournstatic->getNomUrl(1, ''); $societestatic->id = $obj->socid; $societestatic->name = $obj->name; $refcomp = $societestatic->getNomUrl(1, '', 24); $paiement = -1 * $facturefournstatic->getSommePaiement(); // Payment already done } } if ($obj->family == 'invoice') { $facturestatic->ref = $obj->ref; $facturestatic->id = $obj->objid; $facturestatic->type = $obj->type; $ref = $facturestatic->getNomUrl(1, ''); $societestatic->id = $obj->socid; $societestatic->name = $obj->name; $refcomp = $societestatic->getNomUrl(1, '', 24); $paiement = $facturestatic->getSommePaiement(); // Payment already done }
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $objp->propalid; print $formfile->getDocumentsLink($objectstatic->element, $filename, $filedir); print '</td></tr></table>'; print "</td>\n"; // Customer ref print '<td class="nocellnopadd nowrap">'; print $objp->ref_client; print '</td>'; $url = DOL_URL_ROOT . '/comm/card.php?socid=' . $objp->rowid; // Company $companystatic->id = $objp->rowid; $companystatic->name = $objp->name; $companystatic->client = $objp->client; $companystatic->code_client = $objp->code_client; print '<td>'; print $companystatic->getNomUrl(1, 'customer'); print '</td>'; // Town print '<td class="nocellnopadd">'; print $objp->town; print '</td>'; // Date proposal print '<td align="center">'; print dol_print_date($db->jdate($objp->dp), 'day'); print "</td>\n"; // Date end validity if ($objp->dfv) { print '<td align="center">' . dol_print_date($db->jdate($objp->dfv), 'day'); print '</td>'; } else { print '<td> </td>';
$userfee->fetch($deplacement->fk_user); print $userfee->getNomUrl(1); print '</td></tr>'; // Date print '<tr><td>'.$langs->trans("Date").'</td><td>'; print dol_print_date($deplacement->date,'day'); print '</td></tr>'; // Km/Price print '<tr><td>'.$langs->trans("FeesKilometersOrAmout").'</td><td>'.$deplacement->km.'</td></tr>'; // Where print '<tr><td>'.$langs->trans("CompanyVisited").'</td>'; print '<td>'; if ($soc->id) print $soc->getNomUrl(1); print '</td></tr>'; // Project if ($conf->projet->enabled) { $langs->load('projects'); print '<tr>'; print '<td>'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('Project'); print '</td>'; if ($_GET['action'] != 'classin') { print '<td align="right"><a href="'.$_SERVER["PHP_SELF"].'?action=classin&id='.$deplacement->id.'">';
$arrayforsort = $amount; } if ($sortfield == 'amount_ttc' && $sortorder == 'desc') { arsort($amount); $arrayforsort = $amount; } foreach ($arrayforsort as $key => $value) { $var = !$var; print "<tr " . $bc[$var] . ">"; // Third party $fullname = $name[$key]; if ($key > 0) { $thirdparty_static->id = $key; $thirdparty_static->name = $fullname; $thirdparty_static->client = 1; $linkname = $thirdparty_static->getNomUrl(1, 'customer'); } else { $linkname = $langs->trans("PaymentsNotLinkedToInvoice"); } print "<td>" . $linkname . "</td>\n"; // Amount w/o VAT print '<td align="right">'; if ($modecompta != 'CREANCES-DETTES') { if ($key > 0) { print '<a href="' . DOL_URL_ROOT . '/compta/paiement/list.php?socid=' . $key . '">'; } else { print '<a href="' . DOL_URL_ROOT . '/compta/paiement/list.php?socid=-1">'; } } else { if ($key > 0) { print '<a href="' . DOL_URL_ROOT . '/compta/facture/list.php?socid=' . $key . '">';
print '<tr><td>'; print $form->editfieldkey("Date", 'dated', $object->date, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'datepicker'); print '</td><td>'; print $form->editfieldval("Date", 'dated', $object->date, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'datepicker'); print '</td></tr>'; // Km/Price print '<tr><td valign="top">'; print $form->editfieldkey("FeesKilometersOrAmout", 'km', $object->km, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'numeric:6'); print '</td><td>'; print $form->editfieldval("FeesKilometersOrAmout", 'km', $object->km, $object, $conf->global->MAIN_EDIT_ALSO_INLINE && $user->rights->deplacement->creer, 'numeric:6'); print "</td></tr>"; // Where print '<tr><td>' . $langs->trans("CompanyVisited") . '</td>'; print '<td>'; if ($soc->id) { print $soc->getNomUrl(1); } print '</td></tr>'; // Project if (!empty($conf->projet->enabled)) { $langs->load('projects'); print '<tr>'; print '<td>'; print '<table class="nobordernopadding" width="100%"><tr><td>'; print $langs->trans('Project'); print '</td>'; if ($action != 'classify' && $user->rights->deplacement->creer) { print '<td align="right"><a href="' . $_SERVER["PHP_SELF"] . '?action=classify&id=' . $object->id . '">'; print img_edit($langs->trans('SetProject'), 1); print '</a></td>'; }
if ($ret == 'html') print '<br>'; } /* * Livraison */ print '<table class="border" width="100%">'; // Ref print '<tr><td width="20%">'.$langs->trans("Ref").'</td>'; print '<td colspan="3">'.$delivery->ref.'</td></tr>'; // Client print '<tr><td width="20%">'.$langs->trans("Customer").'</td>'; print '<td align="3">'.$soc->getNomUrl(1).'</td>'; print "</tr>"; // Document origine if ($typeobject == 'commande' && $expedition->origin_id && $conf->commande->enabled) { 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) {
print '</td></tr>'; // Realised by if (!empty($conf->global->AGENDA_ENABLE_DONEBY)) { print '<tr><td class="nowrap">' . $langs->trans("ActionDoneBy") . '</td><td>'; print $form->select_dolusers(GETPOST("doneby") ? GETPOST("doneby") : (!empty($object->userdoneid) && $percent == 100 ? $object->userdoneid : 0), 'doneby', 1); print '</td></tr>'; } print '</table>'; print '<br><br>'; print '<table class="border" width="100%">'; // Societe, contact print '<tr><td width="30%" class="nowrap">' . $langs->trans("ActionOnCompany") . '</td><td>'; if (GETPOST('socid', 'int') > 0) { $societe = new Societe($db); $societe->fetch(GETPOST('socid', 'int')); print $societe->getNomUrl(1); print '<input type="hidden" id="socid" name="socid" value="' . GETPOST('socid', 'int') . '">'; } else { $events = array(); $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php?showempty=1', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); //For external user force the company to user company if (!empty($user->societe_id)) { print $form->select_thirdparty_list($user->societe_id, 'socid', '', 1, 1, 0, $events); } else { print $form->select_thirdparty_list('', 'socid', '', 1, 1, 0, $events); } } print '</td></tr>'; print '<tr><td class="nowrap">' . $langs->trans("ActionOnContact") . '</td><td>'; $form->select_contacts(GETPOST('socid', 'int'), GETPOST('contactid'), 'contactid', 1, '', '', 0, 'minwidth200'); print '</td></tr>';
print '<input type="hidden" name="withproject" value="' . $withproject . '">'; } ?> <div class="tagtd nowrap"><?php echo img_object('', 'contact') . ' ' . $langs->trans("ThirdPartyContacts"); ?> </div> <div class="tagtd nowrap maxwidthonsmartphone"> <?php $selectedCompany = isset($_GET["newcompany"]) ? $_GET["newcompany"] : $object->socid; ?> <?php // add company icon for direct link if ($selectedCompany) { $companystatic->fetch($selectedCompany); echo $companystatic->getNomUrl(2); } ?> <?php $selectedCompany = $formcompany->selectCompaniesForNewContact($object, 'id', $selectedCompany, 'newcompany', '', 0); ?> </div> <div class="tagtd maxwidthonsmartphone"> <?php $nbofcontacts = $form->select_contacts($selectedCompany, '', 'contactid'); ?> </div> <div class="tagtd maxwidthonsmartphone"> <?php $tmpobject = $object; if ($object->element == 'shipping' && is_object($objectsrc)) {
print '</td>'; print '<td align="right" class="liste_titre">'; print '<input class="flat" type="text" size="10" name="search_datec" value="' . $search_datec . '">'; print '</td>'; print '<td class="liste_titre" align="right"><input class="liste_titre" type="image" src="' . DOL_URL_ROOT . '/theme/' . $conf->theme . '/img/search.png" value="' . dol_escape_htmltag($langs->trans("Search")) . '" title="' . dol_escape_htmltag($langs->trans("Search")) . '"></td>'; print '</tr>'; $var = True; while ($i < min($num, $conf->liste_limit)) { $obj = $db->fetch_object($resql); $var = !$var; $thirdpartystatic->id = $obj->socid; $thirdpartystatic->nom = $obj->nom; $thirdpartystatic->status = $obj->status; print "<tr " . $bc[$var] . ">"; print '<td>'; print $thirdpartystatic->getNomUrl(1, 'supplier'); print "</td>\n"; print "<td>" . $obj->ville . "</td>\n"; print '<td align="left">' . $obj->code_fournisseur . ' </td>'; print '<td align="left">' . $obj->code_compta_fournisseur . ' </td>'; print '<td align="right">'; print dol_print_date($db->jdate($obj->datec), 'day') . '</td>'; print '<td align="right">' . $thirdpartystatic->getLibStatut(3) . '</td>'; print "</tr>\n"; $i++; } print "</table>\n"; print "</form>\n"; $db->free($resql); } else { dol_print_error($db);