$formother->select_year($year_create, 'year_create', 1, $min_year, 0); print '</td>'; // UTILISATEUR if ($user->rights->holiday->write_all) { print '<td class="liste_titre" align="left">'; $form->select_users($search_employe, "search_employe", 1, "", 0, ''); print '</td>'; } else { print '<td class="liste_titre"> </td>'; } // VALIDEUR if ($user->rights->holiday->write_all) { print '<td class="liste_titre" align="left">'; $validator = new UserGroup($db); $excludefilter = $user->admin ? '' : 'u.rowid <> ' . $user->id; $valideurobjects = $validator->listUsersForGroup($excludefilter); $valideurarray = array(); foreach ($valideurobjects as $val) { $valideurarray[$val->id] = $val->id; } $form->select_users($search_valideur, "search_valideur", 1, "", 0, $valideurarray, ''); print '</td>'; } else { print '<td class="liste_titre"> </td>'; } // DATE DEBUT print '<td class="liste_titre" colspan="1" align="center">'; print '<input class="flat" type="text" size="1" maxlength="2" name="month_start" value="' . $month_start . '">'; $formother->select_year($year_start, 'year_start', 1, $min_year, $max_year); print '</td>'; // DATE FIN
$action = ''; $socid = $user->societe_id; } $nowyear = strftime("%Y", dol_now()); $year = GETPOST('year') > 0 ? GETPOST('year') : $nowyear; //$startyear=$year-2; $startyear = $year - 1; $endyear = $year; $includeuserlist = array(); if (!empty($conf->global->LEAD_GRP_USER_AFFECT)) { $usergroup = new UserGroup($db); $result = $usergroup->fetch($conf->global->LEAD_GRP_USER_AFFECT); if ($result < 0) { setEventMessage($usergroup->error, 'errors'); } $includeuserlisttmp = $usergroup->listUsersForGroup(); if (is_array($includeuserlisttmp) && count($includeuserlisttmp) > 0) { foreach ($includeuserlisttmp as $usertmp) { $includeuserlist[] = $usertmp->id; } } } $langs->load('lead@lead'); llxHeader('', $langs->trans('Module103111Name')); $stats_lead = new LeadStats($db); if (!empty($userid) && $userid != -1) { $stats_lead->userid = $userid; } if (!empty($socid) && $socid != -1) { $stats_lead->socid = $socid; }
print '<td>' . $langs->trans('RequestByCP') . '</td>'; print '<td>' . $userCreate->getNomUrl(1) . '</td>'; print '</tr>'; } if (!$edit) { print '<tr>'; print '<td width="50%">' . $langs->trans('ReviewedByCP') . '</td>'; print '<td>' . $valideur->getNomUrl(1) . '</td>'; print '</tr>'; } else { print '<tr>'; print '<td width="50%">' . $langs->trans('ReviewedByCP') . '</td>'; // Liste des utiliseurs du groupes choisi dans la config $idGroupValid = $cp->getConfCP('userGroup'); $validator = new UserGroup($db, $idGroupValid); $valideur = $validator->listUsersForGroup('', 1); print '<td>'; $form->select_users($cp->fk_validator, "valideur", 1, "", 0, $valideur, ''); print '</td>'; print '</tr>'; } print '<tr>'; print '<td>' . $langs->trans('DateCreateCP') . '</td>'; print '<td>' . dol_print_date($cp->date_create, 'dayhour') . '</td>'; print '</tr>'; if ($cp->statut == 3) { print '<tr>'; print '<td>' . $langs->trans('DateValidCP') . '</td>'; print '<td>' . dol_print_date($cp->date_valid, 'dayhour') . '</td>'; print '</tr>'; }
$Tab = $PDOdb->ExecuteAsArray($sql); $f1 = fopen('files/convert.sh', 'w'); fputs($f1, "cd " . __DIR__ . "/files \n"); // var_dump($sql,$Tab); foreach ($Tab as $row) { $author = new User($db); $author->fetch($row->fk_user_author); //var_dump( is_file( 'files/'.$row->uid.'.pdf'), dol_buildpath('/query/files/'.$row->uid.'.pdf') ); if ($step == 1) { $url = dol_buildpath('/query/dashboard.php', 2) . '?action=run&uid=' . $row->uid; //echo $url; fputs($f1, "wkhtmltopdf --orientation Landscape " . escapeshellarg($url) . " " . $row->uid . ".pdf \n"); } elseif ($step == 2 && is_file(dol_buildpath('/query/files/' . $row->uid . '.pdf'))) { $g = new UserGroup($db); if ($g->fetch($row->fk_usergroup) > 0) { $TUser = $g->listUsersForGroup(); foreach ($TUser as &$u) { if ($u->statut == 1) { $mailto = $u->email; if (!empty($mailto)) { print "{$mailto} \n"; $m = new TReponseMail($author->email, $mailto, $langs->trans('Report') . ' : ' . $row->title, $langs->trans('PleaseFindYourReportHasAttachement') . " : " . dol_buildpath('/query/dashboard.php?action=run&id=' . $row->rowid, 2)); $m->add_piece_jointe($row->uid . '.pdf', dol_buildpath('/query/files/' . $row->uid . '.pdf')); $m->send(); } } } } unlink(dol_buildpath('/query/files/' . $row->uid . '.pdf')); // suppresion du pdf après envoi par mail }