return $res;
}
+ public static function exportClients($args) {
+ global $core;
+
+ $types = array('Cubedesigners' => 'cube', 'Tous les contacts (Clients de revendeurs inclus)' => 'all');
+ $typeexp = array('Entreprises' => 'entreprises', 'Utilisateurs' => 'users');
+
+ $res = commonPage::barre();
+ $res .= commonPage::tMain();
+ $res .= commonPage::bh();
+ $res.='<form action="' . SITE_PATH . 'tools/exportClientsXLS" method="post" class="notajax">';
+ $res.='<table class="liste">';
+ $res.='<tr><th colspan="3"><strong>' . __('Exporter la base clients') . '</strong></th></tr>';
+ $res.='<tr><td>' . __('Type de client') . '</td><td>' . form::combo('type', $types) . '</td></td>';
+ $res.='<tr><td>' . __('Type d\'export') . '</td><td>' . form::combo('typeexp', $typeexp) . '</td></tr>';
+ $res.='<tr class="odd"><td class="right" colspan="2"><a href="#" class="submit">' . $core->typo->BoutonOK(__('Exporter')) . '</a></td></td>';
+ $res.='</table>';
+ $res.='</form>';
+ $res .= '</div>';
+ $res .= commonPage::bf();
+ $res .= commonPage::bMain();
+ return $res;
+ }
+
+ public static function exportClientsXLS($args) {
+ global $core;
+
+ $sql = 'SELECT * FROM entreprises_ws';
+ if ($_POST['type'] == 'cube') {
+ $sql.=" WHERE revendeur = 'Cubedesigners'";
+ }
+
+ $r = $core->con->select($sql);
+ $entreprises = array();
+ $rows = $r->rows();
+ foreach ($rows as $r) {
+
+ $entreprises[$r['entreprise_id']] = $r;
+ $entreprises[$r['entreprise_id']]['utilisateurs'] = array();
+ }
+
+ $r = $core->con->select('SELECT * FROM utilisateurs_entreprise WHERE entreprise IN(' . implode(',', array_keys($entreprises)) . ')');
+ $rows = $r->rows();
+ foreach ($rows as $r) {
+ $entreprises[$r['entreprise']]['utilisateurs'][$r['utilisateur_id']] = $r;
+ }
+ fb($entreprises);
+ }
+
public static function favicon($args) {
global $core;
$res = commonPage::barre();
}
}
-
?>
$daoBook = new wsDAOBook($core->con);\r
$book = $daoBook->selectById($book_id);\r
\r
+\r
if (is_null($book)) {\r
return;\r
}\r
\r
// Normalize range\r
$range = cubeArray::parseRange($range);\r
+\r
if ($k = array_search(0, $range)) {\r
$range[$k] = 1;\r
}\r
return;\r
}\r
// Paths init\r
- $baseDocument = WS_BOOKS . '/final/' . $book->book_id . '/data/document.pdf';\r
+ $baseDocument = WS_BOOKS . '/final/' . $book->book_id . '/data/' . $book->parametres->pdfName;\r
if (!file_exists($baseDocument)) {\r
return;\r
}\r