本文整理汇总了PHP中Project::getNomUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getNomUrl方法的具体用法?PHP Project::getNomUrl怎么用?PHP Project::getNomUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::getNomUrl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_format_libelle_projet
function get_format_libelle_projet($fk)
{
global $db;
if ($fk > 0) {
dol_include_once('/projet/class/project.class.php');
$o = new Project($db);
if ($o->fetch($fk) > 0) {
return $o->getNomUrl(1);
} else {
return $fk;
}
}
return '';
}
示例2: Project
if ($object->contact->fetch($object->contactid)) {
print "<br>" . dol_print_phone($object->contact->phone_pro);
}
}
} else {
print $langs->trans("None");
}
print '</td></tr>';
}
// Project
if (!empty($conf->projet->enabled)) {
print '<tr><td width="30%">' . $langs->trans("Project") . '</td><td colspan="3">';
if ($object->fk_project) {
$project = new Project($db);
$project->fetch($object->fk_project);
print $project->getNomUrl(1, '', 1);
}
print '</td></tr>';
}
// Priority
print '<tr><td class="nowrap" width="30%">' . $langs->trans("Priority") . '</td><td colspan="3">';
print $object->priority ? $object->priority : '';
print '</td></tr>';
// Object linked
if (!empty($object->fk_element) && !empty($object->elementtype)) {
include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
print '<tr><td>' . $langs->trans("LinkedObject") . '</td>';
print '<td colspan="3">' . dolGetElementUrl($object->fk_element, $object->elementtype, 1) . '</td></tr>';
}
// Description
print '<tr><td class="tdtop">' . $langs->trans("Description") . '</td><td colspan="3">';
示例3: Project
if ($object->contact->id && $object->type_code == 'AC_TEL') {
if ($object->contact->fetch($object->contact->id)) {
print "<br>" . dol_print_phone($object->contact->phone_pro);
}
}
} else {
print $langs->trans("None");
}
print '</td></tr>';
// Project
if (!empty($conf->projet->enabled)) {
print '<tr><td class="tdtop">' . $langs->trans("Project") . '</td><td colspan="3">';
if ($object->fk_project) {
$project = new Project($db);
$project->fetch($object->fk_project);
print $project->getNomUrl(1);
}
print '</td></tr>';
}
// Priority
print '<tr><td class="nowrap">' . $langs->trans("Priority") . '</td><td colspan="3">';
print $object->priority ? $object->priority : '';
print '</td></tr>';
// Other attributes
$parameters = array('colspan' => ' colspan="3"', 'colspanvalue' => '3', 'id' => $object->id);
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
// Note that $action and $object may have been modified by hook
if (empty($reshook) && !empty($extrafields->attribute_label)) {
print $object->showOptionals($extrafields, 'edit');
}
print '</table>';
示例4: while
$var = true;
while ($i < $num_lignes) {
$piece_comptable = $i + 1;
$objp = $db->fetch_object($resql);
$var = !$var;
if ($action != 'editline' || $objp->rowid != GETPOST('rowid')) {
print '<tr ' . $bc[$var] . '>';
print '<td style="text-align:center;">';
print img_picto($langs->trans("Document"), "object_generic");
print ' <span>' . $piece_comptable . '</span></td>';
print '<td style="text-align:center;">' . dol_print_date($db->jdate($objp->date), 'day') . '</td>';
print '<td>';
if ($objp->projet_id > 0) {
$projecttmp->id = $objp->projet_id;
$projecttmp->ref = $objp->projet_ref;
print $projecttmp->getNomUrl(1);
}
print '</td>';
print '<td style="text-align:center;">' . $langs->trans("TF_" . strtoupper($objp->type_fees_libelle)) . '</td>';
print '<td style="text-align:left;">' . $objp->comments . '</td>';
print '<td style="text-align:right;">' . vatrate($objp->vatrate, true) . '</td>';
print '<td style="text-align:right;">' . price($objp->value_unit) . '</td>';
print '<td style="text-align:right;">' . $objp->qty . '</td>';
if ($action != 'editline') {
print '<td style="text-align:right;">' . price($objp->total_ht) . '</td>';
print '<td style="text-align:right;">' . price($objp->total_ttc) . '</td>';
}
// Ajout des boutons de modification/suppression
print '<td style="text-align:right;" class="nowrap">';
if ($object->fk_statut < 2 or $object->fk_statut == 99) {
print '<a href="' . $_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=editline&rowid=' . $objp->rowid . '#' . $objp->rowid . '">';
示例5: print_projecttasks_array
/**
* Return HTML table with list of projects and number of opened tasks
*
* @param DoliDB $db Database handler
* @param int $socid Id thirdparty
* @param int $projectsListId Id of project i have permission on
* @param int $mytasks Limited to task i am contact to
* @return void
*/
function print_projecttasks_array($db, $socid, $projectsListId, $mytasks = 0)
{
global $langs, $conf, $user, $bc;
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
$projectstatic = new Project($db);
$sortfield = '';
$sortorder = '';
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Project"), "index.php", "", "", "", "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Tasks"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("Status"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
print "</tr>\n";
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, COUNT(t.rowid) as nb";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
if ($mytasks) {
$sql .= ", " . MAIN_DB_PREFIX . "projet_task as t";
$sql .= ", " . MAIN_DB_PREFIX . "element_contact as ec";
$sql .= ", " . MAIN_DB_PREFIX . "c_type_contact as ctc";
} else {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_task as t ON p.rowid = t.fk_projet";
}
$sql .= " WHERE p.entity = " . $conf->entity;
$sql .= " AND p.rowid IN (" . $projectsListId . ")";
if ($socid) {
$sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = " . $socid . ")";
}
if ($mytasks) {
$sql .= " AND p.rowid = t.fk_projet";
$sql .= " AND ec.element_id = t.rowid";
$sql .= " AND ctc.rowid = ec.fk_c_type_contact";
$sql .= " AND ctc.element = 'project_task'";
$sql .= " AND ec.fk_socpeople = " . $user->id;
}
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut";
$sql .= " ORDER BY p.title, p.ref";
$var = true;
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($resql);
$projectstatic->id = $objp->projectid;
$projectstatic->user_author_id = $objp->fk_user_creat;
$projectstatic->public = $objp->public;
// Check is user has read permission on project
$userAccess = $projectstatic->restrictedProjectArea($user);
if ($userAccess >= 0) {
$var = !$var;
print "<tr " . $bc[$var] . ">";
print '<td class="nowrap">';
$projectstatic->ref = $objp->ref;
print $projectstatic->getNomUrl(1);
print ' - ' . dol_trunc($objp->title, 24) . '</td>';
print '<td align="right">' . $objp->nb . '</td>';
$projectstatic->statut = $objp->fk_statut;
print '<td align="right">' . $projectstatic->getLibStatut(3) . '</td>';
print "</tr>\n";
}
$i++;
}
$db->free($resql);
} else {
dol_print_error($db);
}
print "</table>";
}
示例6:
$taskstatic->ref = $obj->ref;
$taskstatic->label = $obj->label;
$taskstatic->fk_statut = $obj->fk_statut;
$taskstatic->progress = $obj->progress;
$userAccess = $projectstatic->restrictedProjectArea($user); // why this ?
if ($userAccess >= 0)
{
$var=!$var;
print "<tr ".$bc[$var].">";
// Project url
if (! empty($arrayfields['p.ref']['checked']))
{
print '<td class="nowrap">';
print $projectstatic->getNomUrl(1, 'task');
print '</td>';
}
// Title
if (! empty($arrayfields['p.title']['checked']))
{
print '<td>';
print dol_trunc($obj->projecttitle,80);
print '</td>';
}
// Company
if (! empty($arrayfields['s.nom']['checked']))
{
print '<td>';
if ($obj->socid)
{
示例7: print_projecttasks_array
//.........这里部分代码省略.........
$ponderated_opp_amount = 0;
$num = $db->num_rows($resql);
$i = 0;
print '<tr class="liste_titre">';
print_liste_field_titre($title . ' <span class="badge">' . $num . '</span>', $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
print_liste_field_titre($langs->trans("ThirdParty"), $_SERVER["PHP_SELF"], "", "", "", "", $sortfield, $sortorder);
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print_liste_field_titre($langs->trans("OpportunityAmount"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("OpportunityStatus"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
print_liste_field_titre($langs->trans("Tasks"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
if (!in_array('plannedworkload', $hiddenfields)) {
print_liste_field_titre($langs->trans("PlannedWorkload"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
}
if (!in_array('declaredprogress', $hiddenfields)) {
print_liste_field_titre($langs->trans("ProgressDeclared"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
}
}
print_liste_field_titre($langs->trans("Status"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
print "</tr>\n";
while ($i < $num) {
$objp = $db->fetch_object($resql);
$projectstatic->id = $objp->projectid;
$projectstatic->user_author_id = $objp->fk_user_creat;
$projectstatic->public = $objp->public;
// Check is user has read permission on project
$userAccess = $projectstatic->restrictedProjectArea($user);
if ($userAccess >= 0) {
$var = !$var;
print "<tr " . $bc[$var] . ">";
print '<td>';
$projectstatic->ref = $objp->ref;
print $projectstatic->getNomUrl(1);
if (!in_array('projectlabel', $hiddenfields)) {
print ' - ' . dol_trunc($objp->title, 24);
}
print '</td>';
print '<td>';
if ($objp->fk_soc > 0) {
$thirdpartystatic->id = $objp->fk_soc;
$thirdpartystatic->ref = $objp->socname;
$thirdpartystatic->name = $objp->socname;
print $thirdpartystatic->getNomUrl(1);
}
print '</td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print '<td align="right">';
if ($objp->opp_amount) {
print price($objp->opp_amount, 0, '', 1, -1, -1, $conf->currency);
}
print '</td>';
print '<td align="right">';
$code = dol_getIdFromCode($db, $objp->opp_status, 'c_lead_status', 'rowid', 'code');
if ($code) {
print $langs->trans("OppStatus" . $code);
}
print '</td>';
}
$projectstatic->statut = $objp->status;
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
print '<td align="right">' . $objp->nb . '</td>';
$plannedworkload = $objp->planned_workload;
$total_plannedworkload += $plannedworkload;
if (!in_array('plannedworkload', $hiddenfields)) {
print '<td align="right">' . ($plannedworkload ? convertSecondToTime($plannedworkload) : '') . '</td>';
示例8: custom_select_projects
/**
* Override de la fonction classique de la class FormProject
* Show a combo list with projects qualified for a third party
*
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id project preselected
* @param string $htmlname Nom de la zone html
* @param int $maxlength Maximum length of label
* @param int $option_only Option only
* @param int $show_empty Add an empty line
* @return string select or options if OK, void if KO
*/
function custom_select_projects($socid = -1, $selected = '', $htmlname = 'projectid', $type_aff = 'view', $maxlength = 25, $option_only = 0, $show_empty = 1)
{
global $user, $conf, $langs, $db;
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
$out = '';
if ($type_aff == 'view') {
if ($selected > 0) {
$project = new Project($db);
$project->fetch($selected);
//return dol_trunc($project->ref,18).' - '.dol_trunc($project->title,$maxlength);
return $project->getNomUrl(1) . ' - ' . dol_trunc($project->title, $maxlength);
} else {
return $out;
}
}
$hideunselectables = false;
if (!empty($conf->global->PROJECT_HIDE_UNSELECTABLES)) {
$hideunselectables = true;
}
$projectsListId = false;
if (empty($user->rights->projet->all->lire)) {
$projectstatic = new Project($db);
$projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 1);
}
// Search all projects
$sql = 'SELECT p.rowid, p.ref, p.title, p.fk_soc, p.fk_statut, p.public';
$sql .= ' FROM ' . MAIN_DB_PREFIX . 'projet as p';
$sql .= " WHERE p.entity IN (" . getEntity('project', 1) . ")";
if ($projectsListId !== false) {
$sql .= " AND p.rowid IN (" . $projectsListId . ")";
}
if ($socid == 0) {
$sql .= " AND (p.fk_soc=0 OR p.fk_soc IS NULL)";
}
if ($socid > 0) {
$sql .= " AND (p.fk_soc=" . $socid . " OR p.fk_soc IS NULL)";
}
$sql .= " ORDER BY p.ref ASC";
$resql = $db->query($sql);
if ($resql) {
if (empty($option_only)) {
$out .= '<select class="flat" name="' . $htmlname . '">';
}
if (!empty($show_empty)) {
$out .= '<option value="0"> </option>';
}
$num = $db->num_rows($resql);
$i = 0;
if ($num) {
while ($i < $num) {
$obj = $db->fetch_object($resql);
// If we ask to filter on a company and user has no permission to see all companies and project is linked to another company, we hide project.
if ($socid > 0 && (empty($obj->fk_soc) || $obj->fk_soc == $socid) && !$user->rights->societe->lire) {
// Do nothing
} else {
$labeltoshow = dol_trunc($obj->ref, 18);
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("SharedProject").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
if (!empty($selected) && $selected == $obj->rowid && $obj->fk_statut > 0) {
$out .= '<option value="' . $obj->rowid . '" selected="selected">' . $labeltoshow . ' - ' . dol_trunc($obj->title, $maxlength) . '</option>';
} else {
$disabled = 0;
$labeltoshow .= ' ' . dol_trunc($obj->title, $maxlength);
if (!$obj->fk_statut > 0) {
$disabled = 1;
$labeltoshow .= ' - ' . $langs->trans("Draft");
}
if ($socid > 0 && (!empty($obj->fk_soc) && $obj->fk_soc != $socid)) {
$disabled = 1;
$labeltoshow .= ' - ' . $langs->trans("LinkedToAnotherCompany");
}
if ($hideunselectables && $disabled) {
$resultat = '';
} else {
$resultat = '<option value="' . $obj->rowid . '"';
if ($disabled) {
$resultat .= ' disabled="disabled"';
}
//if ($obj->public) $labeltoshow.=' ('.$langs->trans("Public").')';
//else $labeltoshow.=' ('.$langs->trans("Private").')';
$resultat .= '>';
$resultat .= $labeltoshow;
$resultat .= '</option>';
}
$out .= $resultat;
}
}
$i++;
//.........这里部分代码省略.........
示例9: FormProjets
/**
* Show a form to select a project
*
* @param int $page Page
* @param int $socid Id third party (-1=all, 0=only projects not linked to a third party, id=projects not linked or linked to third party id)
* @param int $selected Id pre-selected project
* @param string $htmlname Name of select field
* @param int $discard_closed Discard closed projects (0=Keep,1=hide completely except $selected,2=Disable)
* @param int $maxlength Max length
* @param int $forcefocus Force focus on field (works with javascript only)
* @return void
*/
function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 0, $maxlength = 20, $forcefocus = 0)
{
global $langs;
require_once DOL_DOCUMENT_ROOT . '/core/lib/project.lib.php';
require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php';
$formproject = new FormProjets($this->db);
$langs->load("project");
if ($htmlname != "none") {
print "\n";
print '<form method="post" action="' . $page . '">';
print '<input type="hidden" name="action" value="classin">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
$formproject->select_projects($socid, $selected, $htmlname, $maxlength, 0, 1, $discard_closed, $forcefocus);
print '</td>';
print '<td align="left"><input type="submit" class="button" value="' . $langs->trans("Modify") . '"></td>';
print '</tr></table></form>';
} else {
if ($selected) {
$projet = new Project($this->db);
$projet->fetch($selected);
//print '<a href="'.DOL_URL_ROOT.'/projet/card.php?id='.$selected.'">'.$projet->title.'</a>';
print $projet->getNomUrl(0, '', 1);
} else {
print " ";
}
}
}
示例10: Project
/**
* Show a form to select a project
* @param page Page
* @param socid Id societe
* @param selected Id projet pre-selectionne
* @param htmlname Nom du formulaire select
*/
function form_project($page, $socid, $selected = '', $htmlname = 'projectid')
{
global $langs;
require_once DOL_DOCUMENT_ROOT . "/lib/project.lib.php";
$langs->load("project");
if ($htmlname != "none") {
print '<form method="post" action="' . $page . '">';
print '<input type="hidden" name="action" value="classin">';
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
print '<table class="nobordernopadding" cellpadding="0" cellspacing="0">';
print '<tr><td>';
//print "$socid,$selected,$htmlname";
select_projects($socid, $selected, $htmlname);
print '</td>';
print '<td align="left"><input type="submit" class="button" value="' . $langs->trans("Modify") . '"></td>';
print '</tr></table></form>';
} else {
if ($selected) {
$projet = new Project($this->db);
$projet->fetch($selected);
//print '<a href="'.DOL_URL_ROOT.'/projet/fiche.php?id='.$selected.'">'.$projet->title.'</a>';
print $projet->getNomUrl(0);
} else {
print " ";
}
}
}
示例11: _events
//.........这里部分代码省略.........
$sql .= " AND (";
if ($filtert > 0) {
$sql .= "ar.fk_element = " . $filtert;
}
if ($usergroup > 0) {
$sql .= ($filtert > 0 ? " OR " : "") . " ugu.fk_usergroup = " . $usergroup;
}
$sql .= ")";
}
// Sort on date
$sql .= ' ORDER BY datep';
$TEvent = array();
if (isset($_REQUEST['DEBUG'])) {
print $sql;
}
$res = $db->query($sql);
//var_dump($db);
$TSociete = array();
$TContact = array();
$TUser = array();
$TProject = array();
$TEventObject = array();
while ($obj = $db->fetch_object($res)) {
$event = new ActionComm($db);
$event->fetch($obj->id);
$event->fetch_userassigned();
$event->color = $obj->color;
$TEventObject[] = $event;
}
foreach ($TEventObject as &$event) {
if ($event->socid > 0 && !isset($TSociete[$event->socid])) {
$societe = new Societe($db);
$societe->fetch($event->socid);
$TSociete[$event->socid] = $societe->getNomUrl(1);
}
if ($event->contactid > 0 && !isset($TContact[$event->contactid])) {
$contact = new Contact($db);
$contact->fetch($event->contactid);
$TContact[$event->contactid] = $contact->getNomUrl(1);
}
$TUserassigned = array();
$TColor = array();
if ($event->color && empty($conf->global->FULLCALENDAR_USE_ASSIGNED_COLOR)) {
$TColor[] = '#' . $event->color;
}
if (!empty($conf->global->FULLCALENDAR_SHOW_AFFECTED_USER)) {
$userownerid = (int) $event->userownerid;
if ($userownerid > 0 && !isset($TUser[$userownerid])) {
$u = new User($db);
$u->fetch($userownerid);
$TUser[$userownerid] = $u;
}
$TUserassigned[$userownerid] = $TUser[$userownerid]->getNomUrl(1);
}
if (!empty($conf->global->FULLCALENDAR_SHOW_PROJECT) && $event->fk_project > 0 && !isset($TProject[$event->fk_project])) {
$p = new Project($db);
$p->fetch($event->fk_project);
$TProject[$event->fk_project] = $p->getNomUrl(1);
}
if (!empty($conf->global->FULLCALENDAR_SHOW_AFFECTED_USER) && !empty($event->userassigned)) {
foreach ($event->userassigned as &$ua) {
$userid = (int) $ua['id'];
if (!isset($TUser[$userid])) {
$u = new User($db);
$u->fetch($userid);
$TUser[$userid] = $u;
示例12: ActionComm
/**
* Write content of pages
*
* @param PDF $pdf Object pdf
* @param Translate $outputlangs Object langs
* @return int 1
*/
function _pages(&$pdf, $outputlangs)
{
global $conf;
$height = 3;
// height for text separation
$pagenb = 1;
$y = $this->_pagehead($pdf, $outputlangs, $pagenb);
$y++;
$pdf->SetFont('', '', 8);
$sql = "SELECT s.nom as thirdparty, s.rowid as socid, s.client,";
$sql .= " a.id, a.datep as dp, a.datep2 as dp2,";
$sql .= " a.fk_contact, a.note, a.percent as percent, a.label, a.fk_project,";
$sql .= " c.code, c.libelle,";
$sql .= " u.login";
$sql .= " FROM " . MAIN_DB_PREFIX . "c_actioncomm as c, " . MAIN_DB_PREFIX . "user as u, " . MAIN_DB_PREFIX . "actioncomm as a";
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "societe as s ON a.fk_soc = s.rowid";
$sql .= " WHERE c.id=a.fk_action AND a.fk_user_author = u.rowid";
$sql .= " AND a.datep BETWEEN '" . $this->db->idate(dol_get_first_day($this->year, $this->month, false)) . "'";
$sql .= " AND '" . $this->db->idate(dol_get_last_day($this->year, $this->month, false)) . "'";
$sql .= " AND a.entity = " . $conf->entity;
$sql .= " ORDER BY a.datep DESC";
$eventstatic = new ActionComm($this->db);
$projectstatic = new Project($this->db);
dol_syslog(get_class($this) . "::_page", LOG_DEBUG);
$resql = $this->db->query($sql);
if ($resql) {
$num = $this->db->num_rows($resql);
$i = 0;
$y0 = $y1 = $y2 = $y3 = 0;
while ($i < $num) {
$obj = $this->db->fetch_object($resql);
$eventstatic->id = $obj->id;
$eventstatic->percentage = $obj->percentage;
$eventstatic->fulldayevent = $obj->fulldayevent;
$eventstatic->punctual = $obj->punctual;
$y = max($y, $pdf->GetY(), $y0, $y1, $y2, $y3);
// Calculate height of text
$text = '';
if (!preg_match('/^' . preg_quote($obj->label) . '/', $obj->note)) {
$text = $obj->label . "\n";
}
$text .= $obj->note;
$text = dol_trunc(dol_htmlentitiesbr_decode($text), 150);
// Add status to text
$text .= "\n";
$status = dol_htmlentitiesbr_decode($eventstatic->getLibStatut(1, 1));
$text .= $status;
if ($obj->fk_project > 0) {
$projectstatic->fetch($obj->fk_project);
$text .= ($status ? ' - ' : '') . $outputlangs->transnoentitiesnoconv("Project") . ": " . dol_htmlentitiesbr_decode($projectstatic->getNomUrl(0, 'nolink'));
}
//print 'd'.$text; exit;
$nboflines = dol_nboflines($text);
$heightlinemax = max(2 * $height, $nboflines * $height);
// Check if there is enough space to print record
if (1 + $y + $heightlinemax >= $this->page_hauteur - $this->marge_haute) {
// We need to break page
$pagenb++;
$y = $this->_pagehead($pdf, $outputlangs, $pagenb);
$y++;
$pdf->SetFont('', '', 8);
}
$y++;
// Date
$pdf->SetXY($this->marge_gauche, $y);
$pdf->MultiCell(22, $height, dol_print_date($this->db->jdate($obj->dp), "day") . "\n" . dol_print_date($this->db->jdate($obj->dp), "hour"), 0, 'L', 0);
$y0 = $pdf->GetY();
// Third party
$pdf->SetXY(26, $y);
$pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($obj->thirdparty), 32), 0, 'L', 0);
$y1 = $pdf->GetY();
// Action code
$code = $obj->code;
if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
if ($code == 'AC_OTH') {
$code = 'AC_MANUAL';
}
if ($code == 'AC_OTH_AUTO') {
$code = 'AC_AUTO';
}
}
$pdf->SetXY(60, $y);
$pdf->MultiCell(32, $height, dol_trunc($outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv("Action" . $code)), 32), 0, 'L', 0);
$y2 = $pdf->GetY();
// Description of event
$pdf->SetXY(106, $y);
$pdf->MultiCell(94, $height, $outputlangs->convToOutputCharset($text), 0, 'L', 0);
$y3 = $pdf->GetY();
$i++;
}
}
return 1;
}
示例13: print_projecttasks_array
/**
* Return HTML table with list of projects and number of opened tasks
*
* @param DoliDB $db Database handler
* @param Form $form Object form
* @param int $socid Id thirdparty
* @param int $projectsListId Id of project i have permission on
* @param int $mytasks Limited to task i am contact to
* @param int $statut -1=No filter on statut, 0 or 1 = Filter on status
* @param array $listofoppstatus List of opportunity status
* @return void
*/
function print_projecttasks_array($db, $form, $socid, $projectsListId, $mytasks = 0, $statut = -1, $listofoppstatus = array())
{
global $langs, $conf, $user, $bc;
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
$projectstatic = new Project($db);
$sortfield = '';
$sortorder = '';
$project_year_filter = 0;
$title = $langs->trans("Projects");
if (strcmp($statut, '') && $statut >= 0) {
$title = $langs->trans("Projects") . ' ' . $langs->trans($projectstatic->statuts_long[$statut]);
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($title, "index.php", "", "", "", "", $sortfield, $sortorder);
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print_liste_field_titre($langs->trans("OpportunityAmount"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
print_liste_field_titre($langs->trans("OpportunityStatus"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
print_liste_field_titre($langs->trans("Tasks"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
}
print_liste_field_titre($langs->trans("Status"), "", "", "", "", 'align="right"', $sortfield, $sortorder);
print "</tr>\n";
$sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut as status, p.fk_opp_status as opp_status, p.opp_amount, COUNT(DISTINCT t.rowid) as nb";
// We use DISTINCT here because line can be doubled if task has 2 links to same user
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
if ($mytasks) {
$sql .= ", " . MAIN_DB_PREFIX . "projet_task as t";
$sql .= ", " . MAIN_DB_PREFIX . "element_contact as ec";
$sql .= ", " . MAIN_DB_PREFIX . "c_type_contact as ctc";
} else {
$sql .= " LEFT JOIN " . MAIN_DB_PREFIX . "projet_task as t ON p.rowid = t.fk_projet";
}
$sql .= " WHERE p.entity = " . $conf->entity;
$sql .= " AND p.rowid IN (" . $projectsListId . ")";
if ($socid) {
$sql .= " AND (p.fk_soc IS NULL OR p.fk_soc = 0 OR p.fk_soc = " . $socid . ")";
}
if ($mytasks) {
$sql .= " AND p.rowid = t.fk_projet";
$sql .= " AND ec.element_id = t.rowid";
$sql .= " AND ctc.rowid = ec.fk_c_type_contact";
$sql .= " AND ctc.element = 'project_task'";
$sql .= " AND ec.fk_socpeople = " . $user->id;
}
if ($statut >= 0) {
$sql .= " AND p.fk_statut = " . $statut;
}
if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) {
$project_year_filter = GETPOST("project_year_filter");
//Check if empty or invalid year. Wildcard ignores the sql check
if ($project_year_filter != "*") {
if (empty($project_year_filter) || !ctype_digit($project_year_filter)) {
$project_year_filter = date("Y");
}
$sql .= " AND (p.dateo IS NULL OR p.dateo <= " . $db->idate(dol_get_last_day($project_year_filter, 12, false)) . ")";
$sql .= " AND (p.datee IS NULL OR p.datee >= " . $db->idate(dol_get_first_day($project_year_filter, 1, false)) . ")";
}
}
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.fk_user_creat, p.public, p.fk_statut, p.fk_opp_status, p.opp_amount";
$sql .= " ORDER BY p.title, p.ref";
$var = true;
$resql = $db->query($sql);
if ($resql) {
$total_task = 0;
$total_opp_amount = 0;
$ponderated_opp_amount = 0;
$num = $db->num_rows($resql);
$i = 0;
while ($i < $num) {
$objp = $db->fetch_object($resql);
$projectstatic->id = $objp->projectid;
$projectstatic->user_author_id = $objp->fk_user_creat;
$projectstatic->public = $objp->public;
// Check is user has read permission on project
$userAccess = $projectstatic->restrictedProjectArea($user);
if ($userAccess >= 0) {
$var = !$var;
print "<tr " . $bc[$var] . ">";
print '<td class="nowrap">';
$projectstatic->ref = $objp->ref;
print $projectstatic->getNomUrl(1);
print ' - ' . dol_trunc($objp->title, 24) . '</td>';
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print '<td align="right">';
if ($objp->opp_amount) {
print price($objp->opp_amount, 0, '', 1, -1, -1, $conf->currency);
//.........这里部分代码省略.........
示例14:
if (empty($conf->global->SUPPLIER_ORDER_HIDE_REF_SUPPLIER)) {
print '<td>' . $obj->ref_supplier . '</td>' . "\n";
}
// Thirdparty
print '<td>';
$thirdpartytmp->id = $obj->socid;
$thirdpartytmp->name = $obj->name;
print $thirdpartytmp->getNomUrl(1, 'supplier');
print '</td>' . "\n";
// Project
if (!empty($conf->global->PROJECT_SHOW_REF_INTO_LISTS)) {
$projectstatic->id = $obj->project_id;
$projectstatic->ref = $obj->project_ref;
print '<td>';
if ($obj->project_id > 0) {
print $projectstatic->getNomUrl(1);
}
print '</td>';
}
// Author
$userstatic->id = $obj->fk_user_author;
$userstatic->lastname = $obj->lastname;
$userstatic->firstname = $obj->firstname;
$userstatic->login = $obj->login;
$userstatic->photo = $obj->photo;
print "<td>";
if ($userstatic->id) {
print $userstatic->getNomUrl(1);
} else {
print " ";
}
示例15: strftime
$sql .= " AND date_format(task_date,'%y-%m-%d') = '" . strftime("%y-%m-%d", $now) . "'";
$sql .= " AND p.rowid in (" . $projectsListId . ")";
$sql .= " GROUP BY p.rowid, p.ref, p.title, p.public";
$resql = $db->query($sql);
if ($resql) {
$var = true;
$total = 0;
while ($row = $db->fetch_object($resql)) {
$var = !$var;
print "<tr " . $bc[$var] . ">";
print '<td>';
$projectstatic->id = $row->rowid;
$projectstatic->ref = $row->ref;
$projectstatic->title = $row->title;
$projectstatic->public = $row->public;
print $projectstatic->getNomUrl(1, '', 1);
print '</td>';
print '<td align="right">' . convertSecondToTime($row->nb, 'allhourmin') . '</td>';
print "</tr>\n";
$total += $row->nb;
}
$db->free($resql);
} else {
dol_print_error($db);
}
print '<tr class="liste_total">';
print '<td>' . $langs->trans('Total') . '</td>';
print '<td align="right">' . convertSecondToTime($total, 'allhourmin') . '</td>';
print "</tr>\n";
print "</table>";
// TODO Do not use date_add function to be compatible with all database