mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2025-02-20 13:46:52 +01:00
better attendded woth project tabs
This commit is contained in:
parent
11dcf656c6
commit
c3f4e5e2d5
|
|
@ -30,6 +30,8 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
|
|||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorbooth.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/class/conferenceorboothattendee.class.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/eventorganization/lib/eventorganization_conferenceorbooth.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("eventorganization", "other"));
|
||||
|
|
@ -46,10 +48,12 @@ $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
|
|||
//$lineid = GETPOST('lineid', 'int');
|
||||
|
||||
$conf_or_booth_id = GETPOST('conforboothid', 'int');
|
||||
$withproject = GETPOST('withproject', 'int');
|
||||
|
||||
// Initialize technical objects
|
||||
$object = new ConferenceOrBoothAttendee($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$projectstatic = new Project($db);
|
||||
$diroutputmassaction = $conf->eventorganization->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('conferenceorboothattendeecard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
|
|
@ -166,11 +170,189 @@ $title = $langs->trans("ConferenceOrBoothAttendee");
|
|||
$help_url = '';
|
||||
llxHeader('', $title, $help_url);
|
||||
|
||||
$result = $projectstatic->fetch($confOrBooth->fk_project);
|
||||
if (!empty($conf->global->PROJECT_ALLOW_COMMENT_ON_PROJECT) && method_exists($projectstatic, 'fetchComments') && empty($projectstatic->comments)) {
|
||||
$projectstatic->fetchComments();
|
||||
}
|
||||
if (!empty($projectstatic->socid)) {
|
||||
$projectstatic->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$withProjectUrl='';
|
||||
$object->project = clone $projectstatic;
|
||||
|
||||
if (!empty($withproject)) {
|
||||
// Tabs for project
|
||||
$tab = 'eventorganisation';
|
||||
$withProjectUrl="&withproject=1";
|
||||
$head = project_prepare_head($projectstatic);
|
||||
print dol_get_fiche_head($head, $tab, $langs->trans("Project"), -1, ($projectstatic->public ? 'projectpub' : 'project'), 0, '', '');
|
||||
|
||||
$param = ($mode == 'mine' ? '&mode=mine' : '');
|
||||
|
||||
// Project card
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php?restore_lastsearch_values=1">'.$langs->trans("BackToList").'</a>';
|
||||
|
||||
$morehtmlref = '<div class="refidno">';
|
||||
// Title
|
||||
$morehtmlref .= $projectstatic->title;
|
||||
// Thirdparty
|
||||
if ($projectstatic->thirdparty->id > 0) {
|
||||
$morehtmlref .= '<br>'.$langs->trans('ThirdParty').' : '.$projectstatic->thirdparty->getNomUrl(1, 'project');
|
||||
}
|
||||
$morehtmlref .= '</div>';
|
||||
|
||||
// Define a complementary filter for search of next/prev ref.
|
||||
if (!$user->rights->projet->all->lire) {
|
||||
$objectsListId = $projectstatic->getProjectsAuthorizedForUser($user, 0, 0);
|
||||
$projectstatic->next_prev_filter = " rowid IN (".$db->sanitize(count($objectsListId) ?join(',', array_keys($objectsListId)) : '0').")";
|
||||
}
|
||||
|
||||
dol_banner_tab($projectstatic, 'project_ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
|
||||
|
||||
print '<div class="fichecenter">';
|
||||
print '<div class="fichehalfleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border tableforfield centpercent">';
|
||||
|
||||
// Usage
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES) || empty($conf->global->PROJECT_HIDE_TASKS) || !empty($conf->eventorganization->enabled)) {
|
||||
print '<tr><td class="tdtop">';
|
||||
print $langs->trans("Usage");
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
if (!empty($conf->global->PROJECT_USE_OPPORTUNITIES)) {
|
||||
print '<input type="checkbox" disabled name="usage_opportunity"'.(GETPOSTISSET('usage_opportunity') ? (GETPOST('usage_opportunity', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_opportunity ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectFollowOpportunity");
|
||||
print $form->textwithpicto($langs->trans("ProjectFollowOpportunity"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS)) {
|
||||
print '<input type="checkbox" disabled name="usage_task"'.(GETPOSTISSET('usage_task') ? (GETPOST('usage_task', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_task ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectFollowTasks");
|
||||
print $form->textwithpicto($langs->trans("ProjectFollowTasks"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
if (empty($conf->global->PROJECT_HIDE_TASKS) && !empty($conf->global->PROJECT_BILL_TIME_SPENT)) {
|
||||
print '<input type="checkbox" disabled name="usage_bill_time"'.(GETPOSTISSET('usage_bill_time') ? (GETPOST('usage_bill_time', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_bill_time ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("ProjectBillTimeDescription");
|
||||
print $form->textwithpicto($langs->trans("BillTime"), $htmltext);
|
||||
print '<br>';
|
||||
}
|
||||
if (!empty($conf->eventorganization->enabled)) {
|
||||
print '<input type="checkbox" disabled name="usage_organize_event"'.(GETPOSTISSET('usage_organize_event') ? (GETPOST('usage_organize_event', 'alpha') != '' ? ' checked="checked"' : '') : ($projectstatic->usage_organize_event ? ' checked="checked"' : '')).'"> ';
|
||||
$htmltext = $langs->trans("EventOrganizationDescriptionLong");
|
||||
print $form->textwithpicto($langs->trans("ManageOrganizeEvent"), $htmltext);
|
||||
}
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Visibility
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Visibility").'</td><td>';
|
||||
if ($projectstatic->public) {
|
||||
print $langs->trans('SharedProject');
|
||||
} else {
|
||||
print $langs->trans('PrivateProject');
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start - end
|
||||
print '<tr><td>'.$langs->trans("DateStart").' - '.$langs->trans("DateEnd").'</td><td>';
|
||||
$start = dol_print_date($projectstatic->date_start, 'day');
|
||||
print ($start ? $start : '?');
|
||||
$end = dol_print_date($projectstatic->date_end, 'day');
|
||||
print ' - ';
|
||||
print ($end ? $end : '?');
|
||||
if ($projectstatic->hasDelay()) {
|
||||
print img_warning("Late");
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Budget
|
||||
print '<tr><td>'.$langs->trans("Budget").'</td><td>';
|
||||
if (strcmp($projectstatic->budget_amount, '')) {
|
||||
print price($projectstatic->budget_amount, '', $langs, 1, 0, 0, $conf->currency);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Other attributes
|
||||
$cols = 2;
|
||||
//include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_view.tpl.php';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<div class="fichehalfright">';
|
||||
print '<div class="ficheaddleft">';
|
||||
print '<div class="underbanner clearboth"></div>';
|
||||
|
||||
print '<table class="border centpercent">';
|
||||
|
||||
// Description
|
||||
print '<td class="titlefield tdtop">'.$langs->trans("Description").'</td><td>';
|
||||
print nl2br($projectstatic->description);
|
||||
print '</td></tr>';
|
||||
|
||||
// Categories
|
||||
if ($conf->categorie->enabled) {
|
||||
print '<tr><td class="valignmiddle">'.$langs->trans("Categories").'</td><td>';
|
||||
print $form->showCategories($projectstatic->id, 'project', 1);
|
||||
print "</td></tr>";
|
||||
}
|
||||
|
||||
print '<tr><td>';
|
||||
$typeofdata = 'checkbox:'.($projectstatic->accept_conference_suggestions ? ' checked="checked"' : '');
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestConfHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestConf', 'accept_conference_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
$typeofdata = 'checkbox:'.($projectstatic->accept_booth_suggestions ? ' checked="checked"' : '');
|
||||
$htmltext = $langs->trans("AllowUnknownPeopleSuggestBoothHelp");
|
||||
print $form->editfieldkey('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '', $projectstatic, 0, $typeofdata, '', 0, 0, 'projectid', $htmltext);
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('AllowUnknownPeopleSuggestBooth', 'accept_booth_suggestions', '1', $projectstatic, 0, $typeofdata, '', 0, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('PriceOfRegistration', 'price_registration', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('PriceOfRegistration', 'price_registration', $projectstatic->price_registration, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td>';
|
||||
print $form->editfieldkey('PriceOfBooth', 'price_booth', '', $projectstatic, 0, 'amount', '', 0, 0, 'projectid');
|
||||
print '</td><td>';
|
||||
print $form->editfieldval('PriceOfBooth', 'price_booth', $projectstatic->price_booth, $projectstatic, 0, 'amount', '', 0, 0, '', 0, '', 'projectid');
|
||||
print "</td></tr>";
|
||||
|
||||
print '<tr><td valign="middle">'.$langs->trans("EventOrganizationICSLink").'</td><td>';
|
||||
print '';
|
||||
print "</td></tr>";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
print '</div>';
|
||||
|
||||
print '<div class="clearboth"></div>';
|
||||
|
||||
print dol_get_fiche_end();
|
||||
|
||||
print '<br>';
|
||||
}
|
||||
|
||||
// Part to create
|
||||
if ($action == 'create') {
|
||||
print load_fiche_titre($langs->trans("NewObject", $langs->transnoentitiesnoconv("ConferenceOrBoothAttendee")), '', 'object_'.$object->picto);
|
||||
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
|
||||
print '<form method="POST" action="'.$_SERVER["PHP_SELF"].(!empty($withProjectUrl)?'?'.$withProjectUrl:'').'">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
if ($confOrBooth->id > 0) {
|
||||
|
|
|
|||
|
|
@ -44,8 +44,6 @@ $objectref = GETPOST("taskref", 'alpha'); // task ref
|
|||
$action = GETPOST('action', 'aZ09');
|
||||
$confirm = GETPOST('confirm', 'alpha');
|
||||
$withproject = GETPOST('withproject', 'int');
|
||||
$project_ref = GETPOST('project_ref', 'alpha');
|
||||
$planned_workload = ((GETPOST('planned_workloadhour', 'int') != '' || GETPOST('planned_workloadmin', 'int') != '') ? (GETPOST('planned_workloadhour', 'int') > 0 ?GETPOST('planned_workloadhour', 'int') * 3600 : 0) + (GETPOST('planned_workloadmin', 'int') > 0 ?GETPOST('planned_workloadmin', 'int') * 60 : 0) : '');
|
||||
|
||||
// Security check
|
||||
$socid = 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user