本文整理汇总了PHP中Project::getLibStatut方法的典型用法代码示例。如果您正苦于以下问题:PHP Project::getLibStatut方法的具体用法?PHP Project::getLibStatut怎么用?PHP Project::getLibStatut使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Project
的用法示例。
在下文中一共展示了Project::getLibStatut方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
print '<td>';
if ($objp->socid) {
$socstatic->id = $objp->socid;
$socstatic->name = $objp->name;
print $socstatic->getNomUrl(1);
} else {
print ' ';
}
print '</td>';
// Visibility
print '<td align="left">';
if ($objp->public) {
print $langs->trans('SharedProject');
} else {
print $langs->trans('PrivateProject');
}
print '</td>';
// Status
$projectstatic->statut = $objp->fk_statut;
print '<td align="right">' . $projectstatic->getLibStatut(5) . '</td>';
print "</tr>\n";
}
$i++;
}
$db->free($resql);
} else {
dol_print_error($db);
}
print "</table>";
llxFooter();
$db->close();
示例2: array
/**
* Define array with couple substitution key => substitution value
*
* @param Project $object Main object to use as data source
* @param Translate $outputlangs Lang object to use for output
* @return array Array of substitution
*/
function get_substitutionarray_object($object, $outputlangs)
{
global $conf;
$resarray = array('object_id' => $object->id, 'object_ref' => $object->ref, 'object_title' => $object->title, 'object_description' => $object->description, 'object_date_creation' => dol_print_date($object->date_c, 'day'), 'object_date_modification' => dol_print_date($object->date_m, 'day'), 'object_date_start' => dol_print_date($object->date_start, 'day'), 'object_date_end' => dol_print_date($object->date_end, 'day'), 'object_note_private' => $object->note_private, 'object_note_public' => $object->note_public, 'object_public' => $object->public, 'object_statut' => $object->getLibStatut());
// Retrieve extrafields
if (is_array($object->array_options) && count($object->array_options)) {
$extrafieldkey = $object->element;
require_once DOL_DOCUMENT_ROOT . '/core/class/extrafields.class.php';
$extrafields = new ExtraFields($this->db);
$extralabels = $extrafields->fetch_name_optionals_label($extrafieldkey, true);
$object->fetch_optionals($object->id, $extralabels);
$resarray = $this->fill_substitutionarray_with_extrafields($object, $resarray, $extrafields, $array_key, $outputlangs);
}
return $resarray;
}
示例3:
{
$socstatic->id=$obj->socid;
$socstatic->name=$obj->name;
print $socstatic->getNomUrl(1);
}
else
{
print ' ';
}
print '</td>';
}
// Status
if (! empty($arrayfields['p.fk_statut']['checked']))
{
print '<td>';
print $projectstatic->getLibStatut(1);
print '</td>';
}
// Ref
if (! empty($arrayfields['t.ref']['checked']))
{
print '<td>';
print $taskstatic->getNomUrl(1,'withproject');
print '</td>';
}
// Label
if (! empty($arrayfields['t.label']['checked']))
{
print '<td>';
print $taskstatic->label;
print '</td>';
示例4: 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>";
}
示例5: print_projecttasks_array
//.........这里部分代码省略.........
}
}
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>';
}
if (!in_array('declaredprogress', $hiddenfields)) {
$declaredprogressworkload = $objp->declared_progess_workload;
$total_declaredprogressworkload += $declaredprogressworkload;
print '<td align="right">';
//print $objp->planned_workload.'-'.$objp->declared_progess_workload."<br>";
print $plannedworkload ? round(100 * $declaredprogressworkload / $plannedworkload, 0) . '%' : '';
print '</td>';
}
}
print '<td align="right">' . $projectstatic->getLibStatut(3) . '</td>';
print "</tr>\n";
$total_task = $total_task + $objp->nb;
$total_opp_amount = $total_opp_amount + $objp->opp_amount;
$ponderated_opp_amount = $ponderated_opp_amount + price2num($listofoppstatus[$objp->opp_status] * $objp->opp_amount / 100);
}
$i++;
}
print '<tr class="liste_total">';
print '<td colspan="2">' . $langs->trans("Total") . "</td>";
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print '<td class="liste_total" align="right">' . price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency) . '</td>';
print '<td class="liste_total" align="right">' . $form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmountDesc"), 1) . '</td>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
print '<td class="liste_total" align="right">' . $total_task . '</td>';
if (!in_array('plannedworkload', $hiddenfields)) {
print '<td class="liste_total" align="right">' . ($total_plannedworkload ? convertSecondToTime($total_plannedworkload) : '') . '</td>';
}
if (!in_array('declaredprogress', $hiddenfields)) {
print '<td class="liste_total" align="right">' . ($total_plannedworkload ? round(100 * $total_declaredprogressworkload / $total_plannedworkload, 0) . '%' : '') . '</td>';
}
}
print '<td class="liste_total"></td>';
print '</tr>';
$db->free($resql);
} else {
dol_print_error($db);
}
print "</table>";
if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) {
//Add the year filter input
print '<form method="get" action="' . $_SERVER["PHP_SELF"] . '">';
print '<table width="100%">';
print '<tr>';
print '<td>' . $langs->trans("Year") . '</td>';
print '<td style="text-align:right"><input type="text" size="4" class="flat" name="project_year_filter" value="' . $project_year_filter . '"/>';
print "</tr>\n";
print '</table></form>';
}
}
示例6: show_projects
/**
* Show html area for list of projects
*
* @param Conf $conf Object conf
* @param Translate $langs Object langs
* @param DoliDB $db Database handler
* @param Object $object Third party object
* @param string $backtopage Url to go once contact is created
* @return void
*/
function show_projects($conf, $langs, $db, $object, $backtopage = '')
{
global $user;
global $bc;
$i = -1;
if (!empty($conf->projet->enabled) && $user->rights->projet->lire) {
$langs->load("projects");
$buttoncreate = '';
if (!empty($conf->projet->enabled) && $user->rights->projet->creer) {
//$buttoncreate='<a class="butAction" href="'.DOL_URL_ROOT.'/projet/card.php?socid='.$object->id.'&action=create&backtopage='.urlencode($backtopage).'">'.$langs->trans("AddProject").'</a>';
$buttoncreate = '<a class="addnewrecord" href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->id . '&action=create&backtopage=' . urlencode($backtopage) . '">' . $langs->trans("AddProject");
if (empty($conf->dol_optimize_smallscreen)) {
$buttoncreate .= ' ' . img_picto($langs->trans("AddProject"), 'filenew');
}
$buttoncreate .= '</a>' . "\n";
}
print "\n";
print_fiche_titre($langs->trans("ProjectsDedicatedToThisThirdParty"), $buttoncreate, '');
print "\n" . '<table class="noborder" width=100%>';
$sql = "SELECT p.rowid as id, p.title, p.ref, p.public, p.dateo as do, p.datee as de, p.fk_statut as status";
$sql .= " FROM " . MAIN_DB_PREFIX . "projet as p";
$sql .= " WHERE p.fk_soc = " . $object->id;
$sql .= " ORDER BY p.dateo DESC";
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows($result);
print '<tr class="liste_titre">';
print '<td>' . $langs->trans("Ref") . '</td><td>' . $langs->trans("Name") . '</td><td align="center">' . $langs->trans("DateStart") . '</td><td align="center">' . $langs->trans("DateEnd") . '</td>';
print '<td align="right">' . $langs->trans("Status") . '</td>';
print '</tr>';
if ($num > 0) {
require_once DOL_DOCUMENT_ROOT . '/projet/class/project.class.php';
$projecttmp = new Project($db);
$i = 0;
$var = true;
while ($i < $num) {
$obj = $db->fetch_object($result);
$projecttmp->fetch($obj->id);
// To verify role of users
$userAccess = $projecttmp->restrictedProjectArea($user);
if ($user->rights->projet->lire && $userAccess > 0) {
$var = !$var;
print "<tr " . $bc[$var] . ">";
// Ref
print '<td><a href="' . DOL_URL_ROOT . '/projet/card.php?id=' . $projecttmp->id . '">' . img_object($langs->trans("ShowProject"), $obj->public ? 'projectpub' : 'project') . " " . $obj->ref . '</a></td>';
// Label
print '<td>' . $obj->title . '</td>';
// Date start
print '<td align="center">' . dol_print_date($db->jdate($obj->do), "day") . '</td>';
// Date end
print '<td align="center">' . dol_print_date($db->jdate($obj->de), "day") . '</td>';
// Status
print '<td align="right">' . $projecttmp->getLibStatut(5) . '</td>';
print '</tr>';
}
$i++;
}
} else {
$var = false;
print '<tr ' . $bc[$var] . '><td colspan="5">' . $langs->trans("None") . '</td></tr>';
}
$db->free($result);
} else {
dol_print_error($db);
}
print "</table>";
print "<br>\n";
}
return $i;
}
示例7: print_projecttasks_array
//.........这里部分代码省略.........
}
$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);
}
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>';
}
print '<td align="right">' . $projectstatic->getLibStatut(3) . '</td>';
print "</tr>\n";
$total_task = $total_task + $objp->nb;
$total_opp_amount = $total_opp_amount + $objp->opp_amount;
$ponderated_opp_amount = $ponderated_opp_amount + price2num($listofoppstatus[$objp->opp_status] * $objp->opp_amount / 100);
}
$i++;
}
print '<tr><td>' . $langs->trans("Total") . "</td>";
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
print '<td align="right">' . price($total_opp_amount, 0, '', 1, -1, -1, $conf->currency) . '</td>';
print '<td align="right">' . $form->textwithpicto(price($ponderated_opp_amount, 0, '', 1, -1, -1, $conf->currency), $langs->trans("OpportunityPonderatedAmount"), 1) . '</td>';
}
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
print '<td align="right">' . $total_task . '</td>';
}
$db->free($resql);
} else {
dol_print_error($db);
}
print "</table>";
if (!empty($conf->global->PROJECT_LIMIT_YEAR_RANGE)) {
//Add the year filter input
print '<form method="get" action="' . $_SERVER["PHP_SELF"] . '">';
print '<table width="100%">';
print '<tr>';
print '<td>' . $langs->trans("Year") . '</td>';
print '<td style="text-align:right"><input type="text" size="4" class="flat" name="project_year_filter" value="' . $project_year_filter . '"/>';
print "</tr>\n";
print '</table></form>';
}
}
示例8: 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
* @param int $statut -1=No filter on statut, 0 or 1 = Filter on status
* @return void
*/
function print_projecttasks_array($db, $socid, $projectsListId, $mytasks = 0, $statut = -1)
{
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("Project");
if ($statut == 0) {
$title = $langs->trans("ProjectDraft");
}
if ($statut == 1) {
$title = $langs->trans("Project") . ' (' . $langs->trans("Validated") . ')';
}
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print_liste_field_titre($title, "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;
}
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";
$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>";
//.........这里部分代码省略.........