print '</td></tr>'; // Due date print '<tr><td>' . $langs->trans('DateMaxPayment') . '</td><td>'; $form->select_date($datedue, 'ech', '', '', '', "add", 1, 1); print '</td></tr>'; // Payment term print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">'; $form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id'); print '</td></tr>'; // Payment mode print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">'; $form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id', 'DBIT'); print '</td></tr>'; // Project if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">'; $formproject->select_projects(empty($conf->global->PROJECT_CAN_ALWAYS_LINK_TO_ALL_SUPPLIERS) ? $societe->id : '-1', $projectid, 'projectid', 0); print '</td></tr>'; } // Incoterms if (!empty($conf->incoterm->enabled)) { print '<tr>'; print '<td><label for="incoterm_id">' . $form->textwithpicto($langs->trans("IncotermLabel"), $objectsrc->libelle_incoterms, 1) . '</label></td>'; print '<td colspan="3" class="maxwidthonsmartphone">'; print $form->select_incoterms(!empty($objectsrc->fk_incoterms) ? $objectsrc->fk_incoterms : '', !empty($objectsrc->location_incoterms) ? $objectsrc->location_incoterms : ''); print '</td></tr>'; } // Bank Account print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">';
if ($ret) { setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs'); } else { setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors'); } $action = ''; } } } /* * View */ llxHeader('', $langs->trans("ExpenseReport")); $form = new Form($db); $formfile = new FormFile($db); $formproject = new FormProjets($db); $projecttmp = new Project($db); if (!empty($conf->global->DEPLACEMENT_TO_CLEAN)) { if (!empty($_GET['mesg'])) { $text_mesg = explode(",", $_GET['mesg']); foreach ($text_mesg as $text) { $mesg .= "- " . $langs->trans($text) . "<br />"; } print "<div class=\"error\" style=\"font-size:15px;background-color:#FFB3B3;\">"; print $langs->trans("LINE_NOT_ADDED") . "<br />"; print $mesg; print "</div>"; } else { if ($mesg) { print "<div class=\"error\" style=\"font-size:16px;background-color:red;\">" . $mesg . "</div>"; }
setEventMessages($langs->trans("RecordSaved"), null, 'mesgs'); // Redirect to avoid submit twice on back header('Location: ' . $_SERVER["PHP_SELF"] . ($projectid ? '?id=' . $projectid : '?') . ($mode ? '&mode=' . $mode : '') . '&year=' . $yearofday . '&month=' . $monthofday . '&day=' . $dayofday); exit; } } else { setEventMessages($langs->trans("ErrorTimeSpentIsEmpty"), null, 'errors'); } } /* * View */ $form = new Form($db); $formother = new FormOther($db); $formcompany = new FormCompany($db); $formproject = new FormProjets($db); $projectstatic = new Project($db); $project = new Project($db); $taskstatic = new Task($db); $prev = dol_getdate($daytoparse - 24 * 3600); $prev_year = $prev['year']; $prev_month = $prev['mon']; $prev_day = $prev['mday']; $next = dol_getdate($daytoparse + 24 * 3600); $next_year = $next['year']; $next_month = $next['mon']; $next_day = $next['mday']; $title = $langs->trans("TimeSpent"); if ($mine) { $title = $langs->trans("MyTimeSpent"); }
// readfile(dol_buildpath('/fullcalendar/lib/fullcalendar/dist/fullcalendar/gcal.js')); } ob_start(); $formactions = new FormActions($db); $formactions->select_type_actions(-1, "type_code", "systemauto"); $select_type_action = ob_get_clean(); $form = new Form($db); //$select_company = $form->select_thirdparty('','fk_soc','',1,1,0); $select_company = $form->select_company('', 'fk_soc', '', 1); $select_user = $form->select_dolusers($user->id, 'fk_user'); ob_start(); $form->select_contacts(-1, -1, 'contactid', 1, '', '', 0, 'minwidth200'); // contactid car nom non pris en compte par l'ajax en vers.<3.9 $select_contact = ob_get_clean(); ob_start(); $formProject = new FormProjets($db); $select_project = $formProject->select_projects_list(-1, 0, 'fk_project', 0, 0, 1); $select_project .= ob_get_clean(); $defaultDay = date('d'); if (!empty($conf->global->MAIN_DEFAULT_WORKING_HOURS)) { list($hourStart, $hourEnd) = explode('-', $conf->global->MAIN_DEFAULT_WORKING_HOURS); } if (empty($hourStart)) { $hourStart = 8; } if (empty($hourEnd)) { $hourEnd = 18; } $moreOptions = ''; $hookmanager->initHooks(array('fullcalendardao')); $parameters = array();
/** * Show filter form in agenda view * * @param Object $form Form object * @param int $canedit Can edit filter fields * @param int $status Status * @param int $year Year * @param int $month Month * @param int $day Day * @param int $showbirthday Show birthday * @param string $filtera Filter on create by user * @param string $filtert Filter on assigned to user * @param string $filterd Filter of done by user * @param int $pid Product id * @param int $socid Third party id * @param string $action Action string * @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend * @param string $actioncode Preselected value of actioncode for filter on type * @param int $usergroupid Id of group to filter on users * @return void */ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $action, $showextcals = array(), $actioncode = '', $usergroupid = '') { global $conf, $user, $langs, $db, $hookmanager; global $begin_h, $end_h, $begin_d, $end_d; $langs->load("companies"); // Filters print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="year" value="' . $year . '">'; print '<input type="hidden" name="month" value="' . $month . '">'; print '<input type="hidden" name="day" value="' . $day . '">'; print '<input type="hidden" name="action" value="' . $action . '">'; print '<input type="hidden" name="showbirthday" value="' . $showbirthday . '">'; print '<div class="fichecenter">'; if (!empty($conf->browser->phone)) { print '<div class="fichehalfleft">'; } else { print '<table class="nobordernopadding" width="100%"><tr><td class="nowrap">'; } print '<table class="nobordernopadding">'; if ($canedit) { print '<tr>'; print '<td class="nowrap">'; print $langs->trans("ActionsToDoBy") . ' '; print '</td><td class="nowrap maxwidthonsmartphone">'; print $form->select_dolusers($filtert, 'usertodo', 1, '', !$canedit); if (empty($conf->dol_optimize_smallscreen)) { print ' ' . $langs->trans("or") . ' ' . $langs->trans("Group") . ' '; } print $form->select_dolgroups($usergroupid, 'usergroup', 1, '', !$canedit); print '</td></tr>'; include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); print '<tr>'; print '<td class="nowrap">'; print $langs->trans("Type"); print ' </td><td class="nowrap maxwidthonsmartphone">'; print $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0); print '</td></tr>'; print '<tr>'; print '<td class="nowrap">'; print $langs->trans("Status"); print ' </td><td class="nowrap maxwidthonsmartphone">'; $formactions->form_select_status_action('formaction', $status, 1, 'status', 1, 2); print '</td></tr>'; } if (!empty($conf->societe->enabled) && $user->rights->societe->lire) { print '<tr>'; print '<td class="nowrap">'; print $langs->trans("ThirdParty") . ' '; print '</td><td class="nowrap maxwidthonsmartphone">'; print $form->select_thirdparty($socid, 'socid'); print '</td></tr>'; } if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; $formproject = new FormProjets($db); print '<tr>'; print '<td class="nowrap">'; print $langs->trans("Project") . ' '; print '</td><td class="nowrap maxwidthonsmartphone">'; $formproject->select_projects($socid ? $socid : -1, $pid, 'projectid'); print '</td></tr>'; } if ($canedit && $action == 'show_peruser') { // Filter on hours print '<tr>'; print '<td class="nowrap">' . $langs->trans("WorkingTimeRange") . '</td>'; print "<td class='nowrap maxwidthonsmartphone'>"; print '<input type="number" class="short" name="begin_h" value="' . $begin_h . '" min="0" max="23">'; if (empty($conf->dol_use_jmobile)) { print ' - '; } print '<input type="number" class="short" name="end_h" value="' . $end_h . '" min="1" max="24">'; if (empty($conf->dol_use_jmobile)) { print ' ' . $langs->trans("H"); } print '</td></tr>'; // Filter on days print '<tr>'; print '<td class="nowrap">' . $langs->trans("WorkingDaysRange") . '</td>'; print "<td class='nowrap maxwidthonsmartphone'>"; print '<input type="number" class="short" name="begin_d" value="' . $begin_d . '" min="1" max="7">'; if (empty($conf->dol_use_jmobile)) { print ' - '; } print '<input type="number" class="short" name="end_d" value="' . $end_d . '" min="1" max="7">'; print '</td></tr>'; } // Hooks $parameters = array('canedit' => $canedit, 'pid' => $pid, 'socid' => $socid); $reshook = $hookmanager->executeHooks('searchAgendaFrom', $parameters, $object, $action); // Note that $action and $object may have been print '</table>'; if (!empty($conf->browser->phone)) { print '</div>'; } else { print '</td>'; } if (!empty($conf->browser->phone)) { print '<div class="fichehalfright">'; } else { print '<td align="center" valign="middle" class="nowrap">'; } print '<table><tr><td align="center">'; print '<div class="formleftzone">'; print '<input type="submit" class="button" style="min-width:120px" name="refresh" value="' . $langs->trans("Refresh") . '">'; print '</div>'; print '</td></tr>'; print '</table>'; if (!empty($conf->browser->phone)) { print '</div>'; } else { print '</td></tr></table>'; } print '</div>'; // Close fichecenter print '<div style="clear:both"></div>'; print '</form>'; }
if ($result <= 0) { setEventMessages($object->error, $object->errors, 'errors'); } else { $object->fetch($result); // Load new object $action = 'edit'; $comefromclone = true; } } } /* * View */ $form = new Form($db); $formfile = new FormFile($db); $formproject = new FormProjets($db); $userstatic = new User($db); $title = $langs->trans("Project") . ' - ' . $object->ref . ' ' . $object->name; if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/', $conf->global->MAIN_HTML_TITLE) && $object->name) { $title = $object->ref . ' ' . $object->name; } $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("", $title, $help_url); if ($action == 'create' && $user->rights->projet->creer) { /* * Create */ $thirdparty = new Societe($db); if ($socid > 0) { $thirdparty->fetch($socid); }
// Thirdparty - Contact if ($conf->societe->enabled) { print '<tr><td width="30%">' . $langs->trans("ActionOnCompany") . '</td>'; print '<td>'; $events = array(); $events[] = array('method' => 'getContacts', 'url' => dol_buildpath('/core/ajax/contacts.php', 1), 'htmlname' => 'contactid', 'params' => array('add-customer-contact' => 'disabled')); print $form->select_company($object->socid, 'socid', '', 1, 1, 0, $events); print '</td>'; // Contact print '<td>' . $langs->trans("Contact") . '</td><td>'; $form->select_contacts($object->socid, $object->contactid, 'contactid', 1, '', '', 0, 'minwidth200'); print '</td></tr>'; } // Project if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); $langs->load("project"); print '<tr><td width="30%">' . $langs->trans("Project") . '</td><td colspan="3">'; $numprojet = $formproject->select_projects($object->socid, $object->fk_project, 'projectid'); if ($numprojet == 0) { print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $object->socid . '&action=create&backtopage=' . urlencode($_SERVER["PHP_SELF"] . '?id=' . $object->id . '&action=edit') . '">' . $langs->trans("AddProject") . '</a>'; } print '</td></tr>'; } // Priority print '<tr><td class="nowrap" width="30%">' . $langs->trans("Priority") . '</td><td colspan="3">'; print '<input type="text" name="priority" value="' . ($object->priority ? $object->priority : '') . '" size="5">'; print '</td></tr>'; // Object linked if (!empty($object->fk_element) && !empty($object->elementtype)) { include_once DOL_DOCUMENT_ROOT . '/core/lib/functions2.lib.php';
} else { $project->fetch($projectid); } // Security check $socid = 0; if ($user->societe_id > 0) { $socid = $user->societe_id; } $result = restrictedArea($user, 'projet', $projectid); /* * View */ $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("", $langs->trans("Referers"), $help_url); $form = new Form($db); $formproject = new FormProjets($db); $userstatic = new User($db); $project = new Project($db); $project->fetch($projectid, $ref); $project->societe->fetch($project->societe->id); // To verify role of users $userAccess = $project->restrictedProjectArea($user); $head = project_prepare_head($project); dol_fiche_head($head, 'element', $langs->trans("Project"), 0, $project->public ? 'projectpub' : 'project'); print '<table class="border" width="100%">'; $linkback = '<a href="' . DOL_URL_ROOT . '/projet/liste.php">' . $langs->trans("BackToList") . '</a>'; print '<tr><td width="30%">' . $langs->trans("Ref") . '</td><td>'; // Define a complementary filter for search of next/prev ref. if (!$user->rights->projet->all->lire) { $projectsListId = $project->getProjectsAuthorizedForUser($user, $mine, 0); $project->next_prev_filter = " rowid in (" . (count($projectsListId) ? join(',', array_keys($projectsListId)) : '0') . ")";
print '</td></tr>'; } // Commercial suivi print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPFOLL") . '</span></td><td>'; print $form->select_dolusers(GETPOST("commercial_suivi_id") ? GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, ''); print '</td></tr>'; // Commercial signature print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPSIGN") . '</span></td><td>'; print $form->select_dolusers(GETPOST("commercial_signature_id") ? GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, ''); print '</td></tr>'; print '<tr><td><span class="fieldrequired">' . $langs->trans("Date") . '</span></td><td>'; $form->select_date($datecontrat, '', 0, 0, '', "contrat"); print "</td></tr>"; // Project if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); print '<tr><td>' . $langs->trans("Project") . '</td><td>'; $formproject->select_projects($soc->id > 0 ? $soc->id : -1, $projectid, "projectid", 0, 0, 1, 1); print "</td></tr>"; } print '<tr><td>' . $langs->trans("NotePublic") . '</td><td valign="top">'; $doleditor = new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); print $doleditor->Create(1); if (empty($user->societe_id)) { print '<tr><td>' . $langs->trans("NotePrivate") . '</td><td valign="top">'; $doleditor = new DolEditor('note_private', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); print $doleditor->Create(1); print '</td></tr>'; } // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
$year = ""; $sday = ""; $smonth = ""; $syear = ""; } // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('projectlist')); $extrafields = new ExtraFields($db); /* * View */ $projectstatic = new Project($db); $socstatic = new Societe($db); $form = new Form($db); $formother = new FormOther($db); $formproject = new FormProjets($db); llxHeader("", $langs->trans("Projects"), "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"); $projectsListId = $projectstatic->getProjectsAuthorizedForUser($user, $mine ? $mine : ($user->rights->projet->all->lire ? 2 : 0), 1, $socid); $sql = "SELECT p.rowid as projectid, p.ref, p.title, p.fk_statut, p.fk_opp_status, p.public, p.fk_user_creat"; $sql .= ", p.datec as date_create, p.dateo as date_start, p.datee as date_end, p.opp_amount"; $sql .= ", s.nom as name, s.rowid as socid"; $sql .= ", cls.code as opp_status_code"; // Add fields for extrafields foreach ($extrafields->attribute_list as $key => $val) { $sql .= ",ef." . $key . ' as options_' . $key; } // Add fields from hooks $parameters = array(); $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook $sql .= $hookmanager->resPrint;
$socid=0; if ($user->societe_id > 0) $socid=$user->societe_id; $result = restrictedArea($user, 'projet', $projectid); /* * View */ $title=$langs->trans("ProjectReferers").' - '.$object->ref.' '.$object->name; if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/projectnameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->ref.' '.$object->name.' - '.$langs->trans("ProjectReferers"); $help_url="EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("",$langs->trans("Referers"),$help_url); $form = new Form($db); $formproject=new FormProjets($db); $formfile = new FormFile($db); $userstatic=new User($db); // To verify role of users $userAccess = $object->restrictedProjectArea($user); $head=project_prepare_head($object); dol_fiche_head($head, 'element', $langs->trans("Project"),0,($object->public?'projectpub':'project')); print '<table class="border" width="100%">'; $linkback = '<a href="'.DOL_URL_ROOT.'/projet/list.php">'.$langs->trans("BackToList").'</a>';
/** * 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 Hide all closed projects * @return void */ function form_project($page, $socid, $selected = '', $htmlname = 'projectid', $discard_closed = 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 '<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, 20, 0, 1, $discard_closed); 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 " "; } } }
/** * Show filter form in agenda view * * @param Object $form Form object * @param int $canedit Can edit filter fields * @param int $status Status * @param int $year Year * @param int $month Month * @param int $day Day * @param int $showbirthday Show birthday * @param string $filtera Filter on create by user * @param string $filtert Filter on assigned to user * @param string $filterd Filter of done by user * @param int $pid Product id * @param int $socid Third party id * @param array $showextcals Array with list of external calendars (used to show links to select calendar), or -1 to show no legend * @param string $actioncode Preselected value of actioncode for filter on type * @return void */ function print_actions_filter($form, $canedit, $status, $year, $month, $day, $showbirthday, $filtera, $filtert, $filterd, $pid, $socid, $showextcals = array(), $actioncode = '') { global $conf, $user, $langs, $db; // Filters print '<form name="listactionsfilter" class="listactionsfilter" action="' . $_SERVER["PHP_SELF"] . '" method="POST">'; print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; print '<input type="hidden" name="status" value="' . $status . '">'; print '<input type="hidden" name="year" value="' . $year . '">'; print '<input type="hidden" name="month" value="' . $month . '">'; print '<input type="hidden" name="day" value="' . $day . '">'; print '<input type="hidden" name="showbirthday" value="' . $showbirthday . '">'; print '<table class="nobordernopadding" width="100%">'; print '<tr><td class="nowrap">'; print '<table class="nobordernopadding">'; if ($canedit) { print '<tr>'; print '<td class="nowrap">'; print $langs->trans("ActionsAskedBy"); print ' </td><td class="nowrap maxwidthonsmartphone">'; print $form->select_dolusers($filtera, 'userasked', 1, '', !$canedit); print '</td>'; print '</tr>'; print '<tr>'; print '<td class="nowrap">'; print $langs->trans("or") . ' ' . $langs->trans("ActionsToDoBy"); print ' </td><td class="nowrap maxwidthonsmartphone">'; print $form->select_dolusers($filtert, 'usertodo', 1, '', !$canedit); print '</td></tr>'; /*print '<tr>'; print '<td class="nowrap">'; print $langs->trans("or") . ' ' . $langs->trans("ActionsDoneBy"); print ' </td><td class="nowrap maxwidthonsmartphone">'; print $form->select_dolusers($filterd, 'userdone', 1, '', ! $canedit); print '</td></tr>';*/ include_once DOL_DOCUMENT_ROOT . '/core/class/html.formactions.class.php'; $formactions = new FormActions($db); print '<tr>'; print '<td class="nowrap">'; print $langs->trans("Type"); print ' </td><td class="nowrap maxwidthonsmartphone">'; print $formactions->select_type_actions($actioncode, "actioncode", '', empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : 0); print '</td></tr>'; } if (!empty($conf->projet->enabled) && $user->rights->projet->lire) { require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; $formproject = new FormProjets($db); print '<tr>'; print '<td class="nowrap">'; print $langs->trans("Project") . ' '; print '</td><td class="nowrap maxwidthonsmartphone">'; $formproject->select_projects($socid ? $socid : -1, $pid, 'projectid', 64); print '</td></tr>'; } print '</table>'; print '</td>'; // Buttons print '<td align="center" valign="middle" class="nowrap">'; print img_picto($langs->trans("ViewCal"), 'object_calendar', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewcal" value="' . $langs->trans("ViewCal") . '">'; print '<br>'; print img_picto($langs->trans("ViewWeek"), 'object_calendarweek', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewweek" value="' . $langs->trans("ViewWeek") . '">'; print '<br>'; print img_picto($langs->trans("ViewDay"), 'object_calendarday', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewday" value="' . $langs->trans("ViewDay") . '">'; print '<br>'; print img_picto($langs->trans("ViewList"), 'object_list', 'class="hideonsmartphone"') . ' <input type="submit" class="button" style="min-width:120px" name="viewlist" value="' . $langs->trans("ViewList") . '">'; print '</td>'; // Legend if ($conf->use_javascript_ajax && is_array($showextcals)) { print '<td align="center" valign="middle" class="nowrap">'; print '<script type="text/javascript">' . "\n"; print 'jQuery(document).ready(function () {' . "\n"; print 'jQuery("#check_mytasks").click(function() { jQuery(".family_mytasks").toggle(); jQuery(".family_other").toggle(); });' . "\n"; print 'jQuery("#check_birthday").click(function() { jQuery(".family_birthday").toggle(); });' . "\n"; print 'jQuery(".family_birthday").toggle();' . "\n"; print '});' . "\n"; print '</script>' . "\n"; print '<table>'; if (!empty($conf->use_javascript_ajax)) { if (count($showextcals) > 0) { print '<tr><td><input type="checkbox" id="check_mytasks" name="check_mytasks" checked="true" disabled="disabled"> ' . $langs->trans("LocalAgenda") . '</td></tr>'; foreach ($showextcals as $val) { $htmlname = dol_string_nospecial($val['name']); print '<tr><td>'; print '<script type="text/javascript">' . "\n"; print 'jQuery(document).ready(function () {' . "\n"; print ' jQuery("#check_' . $htmlname . '").click(function() {'; print ' /* alert("' . $htmlname . '"); */'; print ' jQuery(".family_' . $htmlname . '").toggle();'; print ' });' . "\n"; print '});' . "\n"; print '</script>' . "\n"; print '<input type="checkbox" id="check_' . $htmlname . '" name="check_' . $htmlname . '" checked="true"> ' . $val['name']; print '</td></tr>'; } } } print '<tr><td>' . $langs->trans("AgendaShowBirthdayEvents") . ' <input type="checkbox" id="check_birthday" name="check_birthday"></td></tr>'; print '</table>'; print '</td>'; } print '</tr>'; print '</table>'; print '</form>'; }
if ($ret) { setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); } else { setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); } $action = ''; } } } /* * View */ llxHeader('', $langs->trans("ExpenseReport")); $form = new Form($db); $formfile = new FormFile($db); $formproject = new FormProjets($db); $projecttmp = new Project($db); if (!empty($conf->global->DEPLACEMENT_TO_CLEAN)) { if (!empty($_GET['mesg'])) { $text_mesg = explode(",", $_GET['mesg']); foreach ($text_mesg as $text) { $mesg .= "- " . $langs->trans($text) . "<br />"; } print "<div class=\"error\" style=\"font-size:15px;background-color:#FFB3B3;\">"; print $langs->trans("LINE_NOT_ADDED") . "<br />"; print $mesg; print "</div>"; } else { if ($mesg) { print "<div class=\"error\" style=\"font-size:16px;background-color:red;\">" . $mesg . "</div>"; }
print '.'; print '</td></tr>'; } // Commercial suivi print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPFOLL") . '</span></td><td>'; print $form->select_dolusers(GETPOST("commercial_suivi_id") ? GETPOST("commercial_suivi_id") : $user->id, 'commercial_suivi_id', 1, ''); print '</td></tr>'; // Commercial signature print '<tr><td width="20%" class="nowrap"><span class="fieldrequired">' . $langs->trans("TypeContact_contrat_internal_SALESREPSIGN") . '</span></td><td>'; print $form->select_dolusers(GETPOST("commercial_signature_id") ? GETPOST("commercial_signature_id") : $user->id, 'commercial_signature_id', 1, ''); print '</td></tr>'; print '<tr><td><span class="fieldrequired">' . $langs->trans("Date") . '</span></td><td>'; $form->select_date($datecontrat, '', 0, 0, '', "contrat"); print "</td></tr>"; if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); print '<tr><td>' . $langs->trans("Project") . '</td><td>'; $formproject->select_projects($soc->id, $projectid, "projectid"); print "</td></tr>"; } print '<tr><td>' . $langs->trans("NotePublic") . '</td><td valign="top">'; $doleditor = new DolEditor('note_public', $note_public, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); print $doleditor->Create(1); if (empty($user->societe_id)) { print '<tr><td>' . $langs->trans("NotePrivate") . '</td><td valign="top">'; $doleditor = new DolEditor('note_private', $note_private, '', '100', 'dolibarr_notes', 'In', 1, true, true, ROWS_3, 70); print $doleditor->Create(1); print '</td></tr>'; } // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"');
/** * Fonction generant le projet sur le disque * * @param Project $object Object project a generer * @param Translate $outputlangs Lang output object * @return int 1 if OK, <=0 if KO */ function write_file($object, $outputlangs) { global $user, $langs, $conf; $formproject = new FormProjets($this->db); if (!is_object($outputlangs)) { $outputlangs = $langs; } // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO if (!empty($conf->global->MAIN_USE_FPDF)) { $outputlangs->charset_output = 'ISO-8859-1'; } $outputlangs->load("main"); $outputlangs->load("dict"); $outputlangs->load("companies"); $outputlangs->load("projects"); if ($conf->projet->dir_output) { //$nblignes = count($object->lines); // This is set later with array of tasks $objectref = dol_sanitizeFileName($object->ref); $dir = $conf->projet->dir_output; if (!preg_match('/specimen/i', $objectref)) { $dir .= "/" . $objectref; } $file = $dir . "/" . $objectref . ".pdf"; if (!file_exists($dir)) { if (dol_mkdir($dir) < 0) { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } if (file_exists($dir)) { // Add pdfgeneration hook if (!is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance $heightforinfotot = 50; // Height reserved to output the info and total part $heightforfreetext = isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5; // Height reserved to output the free text on last page $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin) $pdf->SetAutoPageBreak(1, 0); if (class_exists('TCPDF')) { $pdf->setPrintHeader(false); $pdf->setPrintFooter(false); } $pdf->SetFont(pdf_getPDFFont($outputlangs)); // Complete object by loading several other informations $task = new Task($this->db); $tasksarray = $task->getTasksArray(0, 0, $object->id); $object->lines = $tasksarray; $nblignes = count($object->lines); $pdf->Open(); $pagenb = 0; $pdf->SetDrawColor(128, 128, 128); $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref)); $pdf->SetSubject($outputlangs->transnoentities("Project")); $pdf->SetCreator("Dolibarr " . DOL_VERSION); $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs))); $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref) . " " . $outputlangs->transnoentities("Project")); if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) { $pdf->SetCompression(false); } $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right // New page $pdf->AddPage(); $pagenb++; $this->_pagehead($pdf, $object, 1, $outputlangs); $pdf->SetFont('', '', $default_font_size - 1); $pdf->MultiCell(0, 3, ''); // Set interline to 3 $pdf->SetTextColor(0, 0, 0); $tab_top = 50; $tab_height = 200; $tab_top_newpage = 40; $tab_height_newpage = 210; // Affiche notes if (!empty($object->note_public)) { $pdf->SetFont('', '', $default_font_size - 1); $pdf->writeHTMLCell(190, 3, $this->posxref - 1, $tab_top - 2, dol_htmlentitiesbr($object->note_public), 0, 1); $nexY = $pdf->GetY(); $height_note = $nexY - ($tab_top - 2); // Rect prend une longueur en 3eme param $pdf->SetDrawColor(192, 192, 192); $pdf->Rect($this->marge_gauche, $tab_top - 3, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1); $tab_height = $tab_height - $height_note; $tab_top = $nexY + 6; } else { $height_note = 0; } $iniY = $tab_top + 7; $curY = $tab_top + 7; $nexY = $tab_top + 7; $listofreferent = array('propal' => array('name' => "Proposals", 'title' => "ListProposalsAssociatedProject", 'class' => 'Propal', 'table' => 'propal', 'datefieldname' => 'datep', 'test' => $conf->propal->enabled && $user->rights->propale->lire), 'order' => array('name' => "CustomersOrders", 'title' => "ListOrdersAssociatedProject", 'class' => 'Commande', 'table' => 'commande', 'datefieldname' => 'date_commande', 'test' => $conf->commande->enabled && $user->rights->commande->lire), 'invoice' => array('name' => "CustomersInvoices", 'title' => "ListInvoicesAssociatedProject", 'class' => 'Facture', 'margin' => 'add', 'table' => 'facture', 'datefieldname' => 'datef', 'test' => $conf->facture->enabled && $user->rights->facture->lire), 'invoice_predefined' => array('name' => "PredefinedInvoices", 'title' => "ListPredefinedInvoicesAssociatedProject", 'class' => 'FactureRec', 'table' => 'facture_rec', 'datefieldname' => 'datec', 'test' => $conf->facture->enabled && $user->rights->facture->lire), 'order_supplier' => array('name' => "SuppliersOrders", 'title' => "ListSupplierOrdersAssociatedProject", 'class' => 'CommandeFournisseur', 'table' => 'commande_fournisseur', 'datefieldname' => 'date_commande', 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->commande->lire), 'invoice_supplier' => array('name' => "BillsSuppliers", 'title' => "ListSupplierInvoicesAssociatedProject", 'class' => 'FactureFournisseur', 'margin' => 'minus', 'table' => 'facture_fourn', 'datefieldname' => 'datef', 'test' => $conf->fournisseur->enabled && $user->rights->fournisseur->facture->lire), 'contract' => array('name' => "Contracts", 'title' => "ListContractAssociatedProject", 'class' => 'Contrat', 'table' => 'contrat', 'datefieldname' => 'date_contrat', 'test' => $conf->contrat->enabled && $user->rights->contrat->lire), 'intervention' => array('name' => "Interventions", 'title' => "ListFichinterAssociatedProject", 'class' => 'Fichinter', 'table' => 'fichinter', 'datefieldname' => 'date_valid', 'disableamount' => 1, 'test' => $conf->ficheinter->enabled && $user->rights->ficheinter->lire), 'trip' => array('name' => "TripsAndExpenses", 'title' => "ListTripAssociatedProject", 'class' => 'Deplacement', 'table' => 'deplacement', 'datefieldname' => 'dated', 'margin' => 'minus', 'disableamount' => 1, 'test' => $conf->deplacement->enabled && $user->rights->deplacement->lire), 'agenda' => array('name' => "Agenda", 'title' => "ListActionsAssociatedProject", 'class' => 'ActionComm', 'table' => 'actioncomm', 'datefieldname' => 'datep', 'disableamount' => 1, 'test' => $conf->agenda->enabled && $user->rights->agenda->allactions->lire)); foreach ($listofreferent as $key => $value) { $title = $value['title']; $classname = $value['class']; $tablename = $value['table']; $datefieldname = $value['datefieldname']; $qualified = $value['test']; if ($qualified) { $elementarray = $object->get_element_list($key, $tablename, $datefieldname, $dates, $datee); $num = count($elementarray); if ($num > 0) { $nexY = $pdf->GetY() + 5; $curY = $nexY; $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxstatut - $this->posxref, 3, $outputlangs->transnoentities($title), 0, 'L'); $selectList = $formproject->select_element($tablename, $project->thirdparty->id); $nexY = $pdf->GetY() + 1; $curY = $nexY; $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxdate - $this->posxref, 3, $outputlangs->transnoentities("Ref"), 1, 'L'); $pdf->SetXY($this->posxdate, $curY); $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, $outputlangs->transnoentities("Date"), 1, 'C'); $pdf->SetXY($this->posxsociety, $curY); $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $outputlangs->transnoentities("ThirdParty"), 1, 'L'); if (empty($value['disableamount'])) { $pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, $outputlangs->transnoentities("AmountHT"), 1, 'R'); $pdf->SetXY($this->posxamountttc, $curY); $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, $outputlangs->transnoentities("AmountTTC"), 1, 'R'); } else { $pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R'); } $pdf->SetXY($this->posxstatut, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Statut"), 1, 'R'); if (is_array($elementarray) && count($elementarray) > 0) { $nexY = $pdf->GetY(); $curY = $nexY; $total_ht = 0; $total_ttc = 0; $num = count($elementarray); for ($i = 0; $i < $num; $i++) { $element = new $classname($this->db); $element->fetch($elementarray[$i]); $element->fetch_thirdparty(); // print $classname; $qualifiedfortotal = true; if ($key == 'invoice') { if ($element->close_code == 'replaced') { $qualifiedfortotal = false; } // Replacement invoice } $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxdate - $this->posxref, 3, $element->ref, 1, 'L'); // Date if ($tablename == 'commande_fournisseur' || $tablename == 'supplier_order') { $date = $element->date_commande; } else { $date = $element->date; if (empty($date)) { $date = $element->datep; } if (empty($date)) { $date = $element->date_contrat; } if (empty($date)) { $date = $element->datev; } // Fiche inter } $pdf->SetXY($this->posxdate, $curY); $pdf->MultiCell($this->posxsociety - $this->posxdate, 3, dol_print_date($date, 'day'), 1, 'C'); $pdf->SetXY($this->posxsociety, $curY); if (is_object($element->thirdparty)) { $pdf->MultiCell($this->posxamountht - $this->posxsociety, 3, $element->thirdparty->name, 1, 'L'); } // Amount without tax if (empty($value['disableamount'])) { $pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, isset($element->total_ht) ? price($element->total_ht) : ' ', 1, 'R'); $pdf->SetXY($this->posxamountttc, $curY); $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, isset($element->total_ttc) ? price($element->total_ttc) : ' ', 1, 'R'); } else { $pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxstatut - $this->posxamountht, 3, "", 1, 'R'); } // Status if ($element instanceof CommonInvoice) { // This applies for Facture and FactureFournisseur $outputstatut = $element->getLibStatut(1, $element->getSommePaiement()); } else { $outputstatut = $element->getLibStatut(1); } $pdf->SetXY($this->posxstatut, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputstatut, 1, 'R', false, 1, '', '', true, 0, true); if ($qualifiedfortotal) { $total_ht = $total_ht + $element->total_ht; $total_ttc = $total_ttc + $element->total_ttc; } $nexY = $pdf->GetY(); $curY = $nexY; } if (empty($value['disableamount'])) { $curY = $nexY; $pdf->SetXY($this->posxref, $curY); $pdf->MultiCell($this->posxamountttc - $this->posxref, 3, "TOTAL", 1, 'L'); $pdf->SetXY($this->posxamountht, $curY); $pdf->MultiCell($this->posxamountttc - $this->posxamountht, 3, isset($element->total_ht) ? price($total_ht) : ' ', 1, 'R'); $pdf->SetXY($this->posxamountttc, $curY); $pdf->MultiCell($this->posxstatut - $this->posxamountttc, 3, isset($element->total_ttc) ? price($total_ttc) : ' ', 1, 'R'); $pdf->SetXY($this->posxstatut, $curY); $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxstatut, 3, $outputlangs->transnoentities("Nb") . " " . $num, 1, 'L'); } $nexY = $pdf->GetY() + 5; $curY = $nexY; } } } } /* * Pied de page */ $this->_pagefoot($pdf, $object, $outputlangs); if (method_exists($pdf, 'AliasNbPages')) { $pdf->AliasNbPages(); } $pdf->Close(); $pdf->Output($file, 'F'); // Add pdfgeneration hook if (!is_object($hookmanager)) { include_once DOL_DOCUMENT_ROOT . '/core/class/hookmanager.class.php'; $hookmanager = new HookManager($this->db); } $hookmanager->initHooks(array('pdfgeneration')); $parameters = array('file' => $file, 'object' => $object, 'outputlangs' => $outputlangs); global $action; $reshook = $hookmanager->executeHooks('afterPDFCreation', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks if (!empty($conf->global->MAIN_UMASK)) { @chmod($file, octdec($conf->global->MAIN_UMASK)); } return 1; // Pas d'erreur } else { $this->error = $langs->transnoentities("ErrorCanNotCreateDir", $dir); return 0; } } $this->error = $langs->transnoentities("ErrorConstantNotDefined", "LIVRAISON_OUTPUTDIR"); return 0; }
$project->fetch_thirdparty(); $projectid = $project->id; } // Security check $socid = 0; if ($user->societe_id > 0) { $socid = $user->societe_id; } $result = restrictedArea($user, 'projet', $projectid); /* * View */ $help_url = "EN:Module_Projects|FR:Module_Projets|ES:Módulo_Proyectos"; llxHeader("", $langs->trans("Referers"), $help_url); $form = new Form($db); $formproject = new FormProjets($db); $userstatic = new User($db); // To verify role of users $userAccess = $project->restrictedProjectArea($user); $head = project_prepare_head($project); dol_fiche_head($head, 'element', $langs->trans("Project"), 0, $project->public ? 'projectpub' : 'project'); print '<table class="border" width="100%">'; $linkback = '<a href="' . DOL_URL_ROOT . '/projet/list.php">' . $langs->trans("BackToList") . '</a>'; print '<tr><td width="30%">' . $langs->trans("Ref") . '</td><td>'; // Define a complementary filter for search of next/prev ref. if (!$user->rights->projet->all->lire) { $projectsListId = $project->getProjectsAuthorizedForUser($user, $mine, 0); $project->next_prev_filter = " rowid in (" . (count($projectsListId) ? join(',', array_keys($projectsListId)) : '0') . ")"; } print $form->showrefnav($project, 'ref', $linkback, 1, 'ref', 'ref'); print '</td></tr>';
print '</td></tr>'; // Payment term print '<tr><td class="nowrap">' . $langs->trans('PaymentConditionsShort') . '</td><td colspan="2">'; $form->select_conditions_paiements(isset($_POST['cond_reglement_id']) ? $_POST['cond_reglement_id'] : $cond_reglement_id, 'cond_reglement_id'); print '</td></tr>'; // Payment mode print '<tr><td>' . $langs->trans('PaymentMode') . '</td><td colspan="2">'; $form->select_types_paiements(isset($_POST['mode_reglement_id']) ? $_POST['mode_reglement_id'] : $mode_reglement_id, 'mode_reglement_id', 'CRDT'); print '</td></tr>'; // Bank Account print '<tr><td>' . $langs->trans('BankAccount') . '</td><td colspan="2">'; $form->select_comptes($fk_account, 'fk_account', 0, '', 1); print '</td></tr>'; // Project if (!empty($conf->projet->enabled) && $socid > 0) { $formproject = new FormProjets($db); $langs->load('projects'); print '<tr><td>' . $langs->trans('Project') . '</td><td colspan="2">'; $formproject->select_projects($soc->id, $projectid, 'projectid'); print '</td></tr>'; } // Other attributes $parameters = array('objectsrc' => $objectsrc, 'colspan' => ' colspan="3"'); $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'); } // Modele PDF print '<tr><td>' . $langs->trans('Model') . '</td>';
print $formcompany->select_ziptown(isset($_POST["town"]) ? $_POST["town"] : $don->town, 'town', array('zipcode', 'selectcountry_id', 'state_id')); print '</tr>'; print "<tr>" . '<td>' . $langs->trans("Country") . '</td><td><input type="text" name="country" size="40" value="' . $don->country . '"></td></tr>'; print "<tr>" . '<td>' . $langs->trans("EMail") . '</td><td><input type="text" name="email" size="40" value="' . $don->email . '"></td></tr>'; print "<tr><td>" . $langs->trans("PaymentMode") . "</td><td>\n"; if ($don->modepaiementid) { $selected = $don->modepaiementid; } else { $selected = ''; } $form->select_types_paiements($selected, 'modepaiement', 'CRDT', 0, 1); print "</td></tr>\n"; print "<tr>" . '<td>' . $langs->trans("Status") . '</td><td>' . $don->getLibStatut(4) . '</td></tr>'; // Project if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); $langs->load('projects'); print '<tr><td>' . $langs->trans('Project') . '</td><td>'; $formproject->select_projects(-1, isset($_POST["projectid"]) ? $_POST["projectid"] : $don->fk_project, 'projectid'); print '</td></tr>'; } // Other attributes $parameters = array('colspan' => ' colspan="1"'); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $don, $action); // Note that $action and $object may have been modified by hook print "</table>\n"; print '<br><center><input type="submit" class="button" name="save" value="' . $langs->trans("Save") . '"> <input type="submit" class="button" name="cancel" value="' . $langs->trans("Cancel") . '"></center>'; print "</form>\n"; print "</div>\n"; } /* ************************************************************ */
print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">'; dol_fiche_head(''); print '<table class="border" width="100%">'; print '<input type="hidden" name="socid" value=' . $soc->id . '>'; print '<tr><td class="fieldrequired">' . $langs->trans("ThirdParty") . '</td><td>' . $soc->getNomUrl(1) . '</td></tr>'; print '<input type="hidden" name="action" value="add">'; // Ref print '<tr><td class="fieldrequired">' . $langs->trans('Ref') . '</td><td colspan="2">' . $langs->trans("Draft") . '</td></tr>'; // Description (must be a textarea and not html must be allowed (used in list view) print '<tr><td class="tdtop">' . $langs->trans("Description") . '</td>'; print '<td>'; print '<textarea name="description" cols="80" rows="' . ROWS_3 . '">' . GETPOST('description') . '</textarea>'; print '</td></tr>'; // Project if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); $langs->load("project"); print '<tr><td>' . $langs->trans("Project") . '</td><td>'; /* Fix: If a project must be linked to any companies (suppliers or not), project must be not be set as limited to customer but must be not linked to any particular thirdparty if ($societe->fournisseur==1) $numprojet=select_projects(-1,$_POST["projectid"],'projectid'); else $numprojet=select_projects($societe->id,$_POST["projectid"],'projectid'); */ $numprojet = $formproject->select_projects($soc->id, GETPOST('projectid', 'int'), 'projectid'); if ($numprojet == 0) { print ' <a href="' . DOL_URL_ROOT . '/projet/card.php?socid=' . $soc->id . '&action=create">' . $langs->trans("AddProject") . '</a>'; } print '</td></tr>'; } // Contract
} if ($error) { $action = 'edit_extras'; } } } /* * View */ $form = new Form($db); $formother = new FormOther($db); $formfile = new FormFile($db); $formmargin = new FormMargin($db); $bankaccountstatic = new Account($db); if (!empty($conf->projet->enabled)) { $formproject = new FormProjets($db); } $now = dol_now(); llxHeader('', $langs->trans('Bill'), 'EN:Customers_Invoices|FR:Factures_Clients|ES:Facturas_a_clientes'); /** * ******************************************************************* * * Mode creation * * ******************************************************************** */ if ($action == 'create') { $facturestatic = new Facture($db); $extralabels = $extrafields->fetch_name_optionals_label($facturestatic->table_element); print load_fiche_titre($langs->trans('NewBill')); $soc = new Societe($db);
} if (empty($_GET['keysearch']) && !defined('NOREQUIREHTML')) { define('NOREQUIREHTML', '1'); } require '../../main.inc.php'; $htmlname = GETPOST('htmlname', 'alpha'); $socid = GETPOST('socid', 'int'); $action = GETPOST('action', 'alpha'); $id = GETPOST('id', 'int'); /* * View */ dol_syslog(join(',', $_GET)); require_once DOL_DOCUMENT_ROOT . '/core/class/html.formprojet.class.php'; $langs->load("main"); top_httphead(); if (empty($htmlname)) { return; } $match = preg_grep('/(' . $htmlname . '[0-9]+)/', array_keys($_GET)); sort($match); $idprod = !empty($match[0]) ? $match[0] : ''; if (!GETPOST($htmlname) && !GETPOST($idprod)) { return; } // When used from jQuery, the search term is added as GET param "term". $searchkey = GETPOST($idprod) ? GETPOST($idprod) : (GETPOST($htmlname) ? GETPOST($htmlname) : ''); $form = new FormProjets($db); $arrayresult = $form->select_projects_list($socid, '', $htmlname, 0, 0, 1, 0, 0, 0, 1, $searchkey); $db->close(); print json_encode($arrayresult);