本文整理汇总了PHP中Commande::getNomUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Commande::getNomUrl方法的具体用法?PHP Commande::getNomUrl怎么用?PHP Commande::getNomUrl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Commande
的用法示例。
在下文中一共展示了Commande::getNomUrl方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Societe
}
print '<td align="right">' . $langs->trans("AmountTTC") . '</td>';
print '<td align="right">' . $langs->trans("ToBill") . '</td>';
print '<td align="center" width="16"> </td>';
print '</tr>';
$tot_ht = $tot_ttc = $tot_tobill = 0;
$societestatic = new Societe($db);
while ($i < $num) {
$obj = $db->fetch_object($resql);
print "<tr " . $bc[$var] . ">";
print '<td class="nowrap">';
$commandestatic->id = $obj->rowid;
$commandestatic->ref = $obj->ref;
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td width="110" class="nobordernopadding nowrap">';
print $commandestatic->getNomUrl(1);
print '</td>';
print '<td width="20" class="nobordernopadding nowrap">';
print ' ';
print '</td>';
print '<td width="16" align="right" class="nobordernopadding hideonsmartphone">';
$filename = dol_sanitizeFileName($obj->ref);
$filedir = $conf->commande->dir_output . '/' . dol_sanitizeFileName($obj->ref);
$urlsource = $_SERVER['PHP_SELF'] . '?id=' . $obj->rowid;
print $formfile->getDocumentsLink($commandestatic->element, $filename, $filedir);
print '</td></tr></table>';
print '</td>';
print '<td align="left">';
$societestatic->id = $obj->socid;
$societestatic->nom = $obj->nom;
$societestatic->client = 1;
示例2: Commande
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)
{
$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
示例3: get_format_libelle_commande
function get_format_libelle_commande($fk)
{
global $db;
if ($fk > 0) {
$o = new Commande($db);
if ($o->fetch($fk) > 0) {
return $o->getNomUrl(1);
} else {
return $fk;
}
}
return '';
}
示例4: Commande
print '<tr><td width="20%">' . $langs->trans("Ref") . '</td>';
print '<td colspan="3">';
print $form->showrefnav($object, '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' && $object->{$typeobject}->id && !empty($conf->commande->enabled)) {
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>';
示例5: array
print '<tr ' . $bc[$var] . '>';
print '<td class="nowrap">';
$generic_commande->id = $objp->rowid;
$generic_commande->ref = $objp->ref;
$generic_commande->statut = $objp->fk_statut;
$generic_commande->date_commande = $db->jdate($objp->date_commande);
$generic_commande->date_livraison = $db->jdate($objp->date_delivery);
$generic_commande->ref_client = $objp->ref_client;
$generic_commande->total_ht = $objp->total_ht;
$generic_commande->total_tva = $objp->total_tva;
$generic_commande->total_ttc = $objp->total_ttc;
$generic_commande->lines = array();
$generic_commande->getLinesArray();
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">';
print $generic_commande->getNomUrl(1, $viewstatut != 2 ? 0 : $objp->fk_statut);
print '</td>';
// Show shippable Icon (create subloop, so may be slow)
if ($conf->stock->enabled) {
$langs->load("stocks");
if ($objp->fk_statut > 0 && $objp->fk_statut < 3) {
$notshippable = 0;
$warning = 0;
$text_info = '';
$nbprod = 0;
$numlines = count($generic_commande->lines);
// Loop on each line of order
for ($lig = 0; $lig < $numlines; $lig++) {
if ($generic_commande->lines[$lig]->product_type == 0 && $generic_commande->lines[$lig]->fk_product > 0) {
$nbprod++;
// order contains real products
示例6: while
$langs->load("orders");
$i = 0;
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td colspan="3">' . $langs->trans("OrdersToProcess") . '</td></tr>';
$var = True;
while ($i < $num) {
$var = !$var;
$obj = $db->fetch_object($resql);
print "<tr " . $bc[$var] . ">";
print '<td class="nowrap">';
$orderstatic->id = $obj->rowid;
$orderstatic->ref = $obj->ref;
$orderstatic->statut = $obj->fk_statut;
$orderstatic->facturee = 0;
print $orderstatic->getNomUrl(1);
print '</td>';
print '<td>';
$companystatic->name = $obj->name;
$companystatic->id = $obj->socid;
print $companystatic->getNomUrl(1, 'customer', 32);
print '</td>';
print '<td align="right">';
print $orderstatic->getLibStatut(3);
print '</td>';
print '</tr>';
$i++;
}
print "</table><br>";
}
}
示例7: enteteexpedition
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";
}
示例8: Commande
print '<form name="orders2invoice" action="orderstoinvoice.php" method="GET">';
$var = true;
$generic_commande = new Commande($db);
while ($i < $num) {
$objp = $db->fetch_object($resql);
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td class="nowrap">';
$generic_commande->id = $objp->rowid;
$generic_commande->ref = $objp->ref;
$generic_commande->statut = $objp->fk_statut;
$generic_commande->date_commande = $db->jdate($objp->date_commande);
$generic_commande->date_livraison = $db->jdate($objp->date_livraison);
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">';
print $generic_commande->getNomUrl(1, $objp->fk_statut);
print '</td>';
print '<td width="20" class="nobordernopadding nowrap">';
if ($generic_commande->hasDelay()) {
print img_picto($langs->trans("Late"), "warning");
}
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></tr></table>';
print '</td>';
print '<td>' . $objp->ref_client . '</td>';
// Order date
示例9: show_actions_done
//.........这里部分代码省略.........
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;
}
}
示例10:
$generic_commande->id = $objp->rowid;
$generic_commande->ref = $objp->ref;
$shippableOrder->isOrderShippable($objp->rowid);
if (!empty($search_status)) {
$result = $shippableOrder->orderStockStatus(true, 'code');
if (!in_array($result, $search_status)) {
$BdisplayLine = false;
}
}
if ($BdisplayLine == true) {
$var = !$var;
print '<tr ' . $bc[$var] . '>';
print '<td class="nowrap">';
print '<table class="nobordernopadding"><tr class="nocellnopadd">';
print '<td class="nobordernopadding nowrap">';
print $generic_commande->getNomUrl(1);
print '</td>';
print '<td style="min-width: 20px" class="nobordernopadding nowrap">';
if ($objp->fk_statut > 0 && $objp->fk_statut < 3 && max($db->jdate($objp->date_commande), $db->jdate($objp->date_livraison)) < $now - $conf->commande->client->warning_delay) {
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;
示例11: loadBox
/**
* Load data for box to show them 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 . '/commande/class/commande.class.php';
include_once DOL_DOCUMENT_ROOT . '/societe/class/societe.class.php';
$commandestatic = new Commande($db);
$societestatic = new Societe($db);
$userstatic = new User($db);
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast" . ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE ? "" : "Modified") . "CustomerOrders", $max));
if ($user->rights->commande->lire) {
$sql = "SELECT s.nom as name";
$sql .= ", s.rowid as socid";
$sql .= ", s.code_client";
$sql .= ", s.logo";
$sql .= ", c.ref, c.tms";
$sql .= ", c.rowid";
$sql .= ", c.date_commande";
$sql .= ", c.ref_client";
$sql .= ", c.fk_statut";
$sql .= ", c.fk_user_valid";
$sql .= ", c.facture";
$sql .= ", c.total_ht";
$sql .= ", c.tva as total_tva";
$sql .= ", c.total_ttc";
$sql .= " FROM " . MAIN_DB_PREFIX . "societe as s";
$sql .= ", " . MAIN_DB_PREFIX . "commande as c";
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= ", " . MAIN_DB_PREFIX . "societe_commerciaux as sc";
}
$sql .= " WHERE c.fk_soc = s.rowid";
$sql .= " AND c.entity = " . $conf->entity;
if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_VALIDATED_ONLY)) {
$sql .= " AND c.fk_statut = 1";
}
if (!$user->rights->societe->client->voir && !$user->societe_id) {
$sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " . $user->id;
}
if ($user->societe_id) {
$sql .= " AND s.rowid = " . $user->societe_id;
}
if ($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) {
$sql .= " ORDER BY c.date_commande DESC, c.ref DESC ";
} else {
$sql .= " ORDER BY c.tms DESC, c.ref DESC ";
}
$sql .= $db->plimit($max, 0);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
$line = 0;
while ($line < $num) {
$objp = $db->fetch_object($result);
$date = $db->jdate($objp->date_commande);
$datem = $db->jdate($objp->tms);
$commandestatic->id = $objp->rowid;
$commandestatic->ref = $objp->ref;
$commandestatic->ref_client = $objp->ref_client;
$commandestatic->total_ht = $objp->total_ht;
$commandestatic->total_tva = $objp->total_tva;
$commandestatic->total_ttc = $objp->total_ttc;
$societestatic->id = $objp->socid;
$societestatic->name = $objp->name;
$societestatic->code_client = $objp->code_client;
$societestatic->logo = $objp->logo;
$this->info_box_contents[$line][] = array('td' => 'align="left"', 'text' => $commandestatic->getNomUrl(1), 'asis' => 1);
$this->info_box_contents[$line][] = array('td' => 'align="left"', 'text' => $societestatic->getNomUrl(1), 'asis' => 1);
$this->info_box_contents[$line][] = array('td' => 'align="right"', 'text' => price($objp->total_ht, 0, $langs, 0, -1, -1, $conf->currency));
if (!empty($conf->global->ORDER_BOX_LAST_ORDERS_SHOW_VALIDATE_USER)) {
if ($objp->fk_user_valid > 0) {
$userstatic->fetch($objp->fk_user_valid);
}
$this->info_box_contents[$line][] = array('td' => 'align="right"', 'text' => $objp->fk_user_valid > 0 ? $userstatic->getNomUrl(1) : '', 'asis' => 1);
}
$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' => $commandestatic->LibStatut($objp->fk_statut, $objp->facture, 3));
$line++;
}
if ($num == 0) {
$this->info_box_contents[$line][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoRecordedOrders"));
}
$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('align' => 'left', 'text' => $langs->trans("ReadPermissionNotAllowed"));
}
}
示例12: _task
function _task(&$db, $id_task, $values = array())
{
global $user, $langs, $conf;
$task = new Task($db);
if ($id_task) {
$task->fetch($id_task);
$task->fetch_optionals($id_task);
}
if (!empty($values)) {
_set_values($task, $values);
if ($values['status'] == 'inprogress') {
if ($task->progress == 0) {
$task->progress = 5;
} else {
if ($task->progress == 100) {
$task->progress = 95;
}
}
} else {
if ($values['status'] == 'finish') {
$task->progress = 100;
} else {
if ($values['status'] == 'todo') {
$task->progress = 0;
}
}
}
$task->status = $values['status'];
$task->update($user);
}
$task->date_delivery = 0;
if ($task->date_end > 0 && $task->planned_workload > 0) {
$velocity = scrum_getVelocity($db, $task->fk_project);
$task->date_delivery = _get_delivery_date_with_velocity($db, $task, $velocity);
}
$dayInSecond = 86400;
if ($conf->global->TIMESHEET_WORKING_HOUR_PER_DAY) {
$dayInSecond = 60 * 60 * $conf->global->TIMESHEET_WORKING_HOUR_PER_DAY;
}
$task->aff_time = convertSecondToTime($task->duration_effective, 'all', $dayInSecond);
$task->aff_planned_workload = convertSecondToTime($task->planned_workload, 'all', $dayInSecond);
$task->time_rest = $task->planned_workload * (1 - $task->progress / 100);
$task->aff_time_rest = $langs->trans('TimeRest') . ' : ' . convertSecondToTime($task->time_rest, 'all', $dayInSecond);
$task->long_description = $task->divers = '';
if ((int) $task->array_options['options_fk_of'] > 0 && $conf->of->enabled) {
if (!isset($PDOdb)) {
$PDOdb = new TPDOdb();
}
$of = new TAssetOF();
$of->withChild = false;
$of->load($PDOdb, $task->array_options['options_fk_of']);
$link_of = !empty($conf->of->enabled) ? dol_buildpath('/of/fiche_of.php?id=' . $task->array_options['options_fk_of'], 1) : '';
if ($of->fk_soc > 0) {
$soc = new Societe($db);
$soc->fetch($of->fk_soc);
}
$task->divers .= '[<a href="' . $link_of . '">' . $of->numero . '</a>] ' . (!empty($soc) ? $soc->getNomUrl() : '') . '<br />';
if ($of->fk_commande > 0) {
dol_include_once('/commande/class/commande.class.php');
$commande = new Commande($db);
$commande->fetch($of->fk_commande);
$task->divers .= $commande->getNomUrl(1) . '<br />';
}
}
if ((int) $task->array_options['options_fk_product'] > 0 && (empty($conf->global->SCRUMBOARD_ICON_SET) || $conf->global->SCRUMBOARD_ICON_SET != 'null')) {
dol_include_once('/product/class/product.class.php');
$product = new Product($db);
if ($product->fetch((int) $task->array_options['options_fk_product']) > 0) {
$task->divers .= '[' . $product->getNomUrl() . ' ' . $product->label . ']<br />';
$nb_picto = $product->id % 49 - 1;
$y_picto = floor($nb_picto / 7);
$x_picto = $nb_picto - $y_picto * 7;
$w_cell = 27;
$h_cell = 28;
$task->divers .= '<div class="picto" style="float:left; margin-left:3px; background-image:url(./img/' . (!empty($conf->global->SCRUMBOARD_ICON_SET) ? $conf->global->SCRUMBOARD_ICON_SET : 'animal-icons-mini') . '.png);background-position:' . $w_cell * -$x_picto . 'px ' . $h_cell * -$y_picto . 'px;width:' . $w_cell . 'px; height:' . $h_cell . 'px;"></div>';
//var_dump(array($nb_picto,$y_picto, $x_picto,$task->divers));
}
}
if (!empty($task->note_private)) {
$task->divers .= '<br />' . $task->note_private;
}
if ($task->date_start > 0) {
$task->long_description .= $langs->trans('TaskDateStart') . ' : ' . dol_print_date($task->date_start) . '<br />';
}
if ($task->date_end > 0) {
$task->long_description .= $langs->trans('TaskDateEnd') . ' : ' . dol_print_date($task->date_end) . '<br />';
}
if ($task->date_delivery > 0 && $task->date_delivery > $task->date_end) {
$task->long_description .= $langs->trans('TaskDateShouldDelivery') . ' : ' . dol_print_date($task->date_delivery) . '<br />';
}
$task->long_description .= $task->description;
$task->project = new Project($db);
$task->project->fetch($task->fk_project);
$task->project->fetch_optionals($task->fk_project, 'color');
if (!empty($conf->global->SCRUM_SHOW_LINKED_CONTACT)) {
getTContact($task);
}
return _as_array($task);
}
示例13: _fiche
function _fiche(&$PDOdb, &$assetOf, $mode = 'edit', $fk_product_to_add = 0, $fk_nomenclature = 0)
{
global $langs, $db, $conf, $user, $hookmanager;
/***************************************************
* PAGE
*
* Put here all code to build page
****************************************************/
$parameters = array('id' => $assetOf->getId());
$reshook = $hookmanager->executeHooks('doActions', $parameters, $assetOf, $mode);
// Note that $action and $object may have been modified by hook
//pre($assetOf,true);
llxHeader('', $langs->trans('OFAsset'), '', '');
print dol_get_fiche_head(ofPrepareHead($assetOf, 'assetOF'), 'fiche', $langs->trans('OFAsset'));
?>
<style type="text/css">
#assetChildContener .OFMaster {
background:#fff;
-webkit-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.52);
-moz-box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.52);
box-shadow: 4px 4px 5px 0px rgba(50, 50, 50, 0.52);
margin-bottom:20px;
}
</style>
<div class="OFContent" rel="<?php
echo $assetOf->getId();
?>
"> <?php
$TPrixFournisseurs = array();
//$form=new TFormCore($_SERVER['PHP_SELF'],'formeq'.$assetOf->getId(),'POST');
//Affichage des erreurs
if (!empty($assetOf->errors)) {
?>
<br><div class="error">
<?php
foreach ($assetOf->errors as $error) {
echo $error . "<br>";
setEventMessage($error, 'errors');
}
$assetOf->errors = array();
?>
</div><br>
<?php
}
$form = new TFormCore();
$form->Set_typeaff($mode);
$doliform = new Form($db);
if (!empty($_REQUEST['fk_product'])) {
echo $form->hidden('fk_product', $_REQUEST['fk_product']);
}
$TBS = new TTemplateTBS();
$liste = new TListviewTBS('asset');
$TBS->TBS->protect = false;
$TBS->TBS->noerr = true;
$PDOdb = new TPDOdb();
$TNeeded = array();
$TToMake = array();
$TNeeded = _fiche_ligne($form, $assetOf, "NEEDED");
$TToMake = _fiche_ligne($form, $assetOf, "TO_MAKE");
$TIdCommandeFourn = $assetOf->getElementElement($PDOdb);
$HtmlCmdFourn = '';
if (count($TIdCommandeFourn)) {
foreach ($TIdCommandeFourn as $idcommandeFourn) {
$cmd = new CommandeFournisseur($db);
$cmd->fetch($idcommandeFourn);
$HtmlCmdFourn .= $cmd->getNomUrl(1) . " - " . $cmd->getLibStatut(0);
}
}
ob_start();
$doliform->select_produits('', 'fk_product', '', $conf->product->limit_size, 0, -1, 2, '', 3, array());
$select_product = ob_get_clean();
$Tid = array();
//$Tid[] = $assetOf->rowid;
if ($assetOf->getId() > 0) {
$assetOf->getListeOFEnfants($PDOdb, $Tid);
}
$TWorkstation = array();
foreach ($assetOf->TAssetWorkstationOF as $k => &$TAssetWorkstationOF) {
$ws =& $TAssetWorkstationOF->ws;
$TWorkstation[] = array('libelle' => '<a href="' . dol_buildpath('workstation/workstation.php?id=' . $ws->rowid . '&action=view', 2) . '">' . $ws->name . '</a>', 'fk_user' => visu_checkbox_user($PDOdb, $form, $ws->fk_usergroup, $TAssetWorkstationOF->users, 'TAssetWorkstationOF[' . $k . '][fk_user][]', $assetOf->status), 'fk_project_task' => visu_project_task($db, $TAssetWorkstationOF->fk_project_task, $form->type_aff, 'TAssetWorkstationOF[' . $k . '][progress]'), 'fk_task' => visu_checkbox_task($PDOdb, $form, $TAssetWorkstationOF->fk_asset_workstation, $TAssetWorkstationOF->tasks, 'TAssetWorkstationOF[' . $k . '][fk_task][]', $assetOf->status), 'nb_hour' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_hour]', $TAssetWorkstationOF->nb_hour, 3, 10) : ($conf->global->ASSET_USE_CONVERT_TO_TIME ? convertSecondToTime($TAssetWorkstationOF->nb_hour * 3600) : price($TAssetWorkstationOF->nb_hour)), 'nb_hour_real' => $assetOf->status == 'OPEN' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_hour_real]', $TAssetWorkstationOF->nb_hour_real, 3, 10) : ($conf->global->ASSET_USE_CONVERT_TO_TIME ? convertSecondToTime($TAssetWorkstationOF->nb_hour_real * 3600) : price($TAssetWorkstationOF->nb_hour_real)), 'nb_days_before_beginning' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][nb_days_before_beginning]', $TAssetWorkstationOF->nb_days_before_beginning, 3, 10) : $TAssetWorkstationOF->nb_days_before_beginning, 'delete' => $mode == 'edit' && $assetOf->status == 'DRAFT' ? '<a href="javascript:deleteWS(' . $assetOf->getId() . ',' . $TAssetWorkstationOF->getId() . ');">' . img_picto('Supprimer', 'delete.png') . '</a>' : '', 'note_private' => $assetOf->status == 'DRAFT' && $mode == 'edit' ? $form->zonetexte('', 'TAssetWorkstationOF[' . $k . '][note_private]', $TAssetWorkstationOF->note_private, 50, 1) : $TAssetWorkstationOF->note_private, 'rang' => $assetOf->status == 'DRAFT' && $mode == "edit" ? $form->texte('', 'TAssetWorkstationOF[' . $k . '][rang]', $TAssetWorkstationOF->rang, 3, 10) : $TAssetWorkstationOF->rang, 'id' => $ws->getId());
}
$client = new Societe($db);
if ($assetOf->fk_soc > 0) {
$client->fetch($assetOf->fk_soc);
}
$commande = new Commande($db);
if ($assetOf->fk_commande > 0) {
$commande->fetch($assetOf->fk_commande);
}
$TOFParent = array_merge(array(0 => ''), $assetOf->getCanBeParent($PDOdb));
$hasParent = false;
if (!empty($assetOf->fk_assetOf_parent)) {
$TAssetOFParent = new TAssetOF();
$TAssetOFParent->load($PDOdb, $assetOf->fk_assetOf_parent);
$hasParent = true;
}
$parameters = array('id' => $assetOf->getId());
//.........这里部分代码省略.........