]> _ Git - cubeextranet.git/commitdiff
(no commit message)
authorvincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 8 Feb 2011 15:46:38 +0000 (15:46 +0000)
committervincent@cubedesigners.com <vincent@cubedesigners.com@f5622870-0f3c-0410-866d-9cb505b7a8ef>
Tue, 8 Feb 2011 15:46:38 +0000 (15:46 +0000)
inc/commons/class.common.core.php
inc/ws/Controlleur/class.ws.ajax.php
inc/ws/Controlleur/class.ws.url.php
inc/ws/Controlleur/packager/class.ws.packager.win.inst.php
inc/ws/DAO/class.ws.dao.lang.php
inc/ws/Metier/class.ws.lang.php

index a4412e257c93a44c8b6c0b79cb7c7970e9b3d4a7..15194ea23fae919b29fa29c38b63e03203a269bd 100644 (file)
@@ -200,7 +200,7 @@ class commonCore extends cubeCore {
                $db->projets->primary('pk_projets', 'projet_id');\r
                $db->projets->index('index_projets_status', 'BTREE', 'status');\r
                $db->projets->index('index_projets_nom', 'BTREE', 'nom');\r
-               //$db->projets->reference('fk_projets_client', 'client', 'utilisateurs', 'utilisateur_id', false, false);\r
+               // $db->projets->reference('fk_projets_client', 'client', 'utilisateurs', 'utilisateur_id', false, false);\r
                $db->projets->reference('fk_projets_chef', 'chef', 'utilisateurs', 'utilisateur_id', false, false);\r
                // .\r
                // Table taches\r
@@ -213,7 +213,7 @@ class commonCore extends cubeCore {
                $db->taches->projet('integer', 0, false);\r
                // Clés\r
                $db->taches->primary('pk_taches', 'tache_id');\r
-               //$db->taches->reference('fk_taches_projet', 'projet', 'projets', 'projet_id');\r
+               // $db->taches->reference('fk_taches_projet', 'projet', 'projets', 'projet_id');\r
                $db->taches->index('index_taches_nom', 'BTREE', 'nom');\r
                $db->taches->index('index_taches_categorie', 'BTREE', 'categorie');\r
                // .\r
@@ -264,7 +264,7 @@ class commonCore extends cubeCore {
                $db->factures->primary('pk_factures', 'facture_id');\r
                $db->factures->index('index_factures_status', 'BTREE', 'status');\r
                $db->factures->index('index_factures_nom', 'BTREE', 'nom');\r
-               //$db->factures->reference('fk_factures_projet', 'projet', 'projets', 'projet_id');\r
+               // $db->factures->reference('fk_factures_projet', 'projet', 'projets', 'projet_id');\r
                $db->factures->reference('fk_factures_createur', 'createur', 'utilisateurs', 'utilisateur_id');\r
                // .\r
                // Table dashboard\r
@@ -325,6 +325,7 @@ class commonCore extends cubeCore {
                $db->langues->font('varchar', 64, false);\r
                $db->langues->charset('varchar', 64, false);\r
                $db->langues->traductions('text', 0, false);\r
+               $db->langues->nsis('varchar', 64, false);\r
                // Clés\r
                $db->langues->primary('pk_langues', 'lang_id');\r
                // .\r
@@ -346,7 +347,7 @@ class commonCore extends cubeCore {
                $db->documents->index('index_documents_file', 'BTREE', 'file');\r
                $db->documents->index('index_documents_date', 'BTREE', 'date');\r
                $db->documents->index('index_documents_localHash', 'BTREE', 'localHash');\r
-               //$db->documents->reference('fk_documents_proprietaire', 'proprietaire', 'utilisateurs', 'utilisateur_id');\r
+               // $db->documents->reference('fk_documents_proprietaire', 'proprietaire', 'utilisateurs', 'utilisateur_id');\r
                // .\r
                // Table pages des documents\r
                $db->document_links->document_id('integer', 0, false);\r
index bbda3a6687e10200930a08f8625804b80db26d4b..e49fbf561151ff8912d495189f8d08de966e7dc1 100644 (file)
@@ -243,6 +243,7 @@ class wsAjax extends cubeAjax {
                $data['font'] = $_POST['font'];\r
                $data['charset'] = $_POST['charset'];\r
                $data['traductions'] = $_POST['msgid'];\r
+               $data['nsis'] = $_POST['nsis'];\r
                $dao->sauve($data);\r
                $x->addAlert(__('Paramètres de la langue et traductions enregistrées'));\r
        }\r
@@ -328,7 +329,7 @@ class wsAjax extends cubeAjax {
                        'detail' => 'Commentaires');\r
                $mail = new cubeMail();\r
                $mail->charset = 'UTF-8';\r
-               $mail->from = $_POST['prenom'] . ' ' . $_POST['nom'];\r
+               $mail->from = $_POST['prenom'] . ' ' . $_POST['nom'] . '<' . $_POST['email'] . '>';\r
                $mail->to = FROM_EMAIL;\r
                $mail->subject = '[' . EMAIL_SUBJECT . '] Demande de devis';\r
                $body = 'Une demande de devis a été envoyée avec les informations suivantes :' . "\r\n\r\n";\r
index e4b3de71730d14c76b622f60c11413929bd4ffa3..580bf965d29d672b0badd19dc115e0a8bff3e0da 100644 (file)
@@ -40,7 +40,8 @@ class wsUrl {
                $settings = is_null($settings)?$core->user->getSettings('books'):$settings;\r
                $change = is_null($dashboard)?'Books':'Dashboard/' . $dashboard;\r
                $dao = new wsDAOBook($core->con);\r
-               $context_id = is_null($dashboard)?'contextBook':'contextDashboard_' . $dashboard;\r
+               $context_download_id = is_null($dashboard)?'contextDownloadBook':'contextDashboard_Download' . $dashboard;\r
+               $context_status_id = is_null($dashboard)?'contextStatusBook':'contextDashboard_Status' . $dashboard;\r
 \r
                if (isset($settings['search']) && !is_null($settings['search'])) {\r
                        $dao->setSearch($settings['search']);\r
@@ -48,7 +49,8 @@ class wsUrl {
                $dao->setFiltres($settings['filtres']);\r
                $liste = $dao->getListe($settings['orderby'], $settings['sens'], $settings['limit'], $core->user);\r
 \r
-               $res = self::contextBookDownload($context_id);\r
+               $res = self::contextBookDownload($context_download_id);\r
+               $res = self::contextBookStatus($context_status_id);\r
 \r
                $res .= '<table class="liste">';\r
                $res .= '<tr><th>' . commonUrl::orderby('#', 'book_id', $settings, 'sort' . $change) . '</th>';\r
@@ -95,12 +97,16 @@ class wsUrl {
                                $res .= '<td>' . $book->facturable . '</td>';\r
                        }\r
                        if ($droits->revendeur) {\r
-                               $res .= '<td>' . $core->books_status[$book->status] . '</td>';\r
+                               if ($droits->admin || $book->status <= 1) {\r
+                                       $res .= '<td><a href="#" class="openContextMenu" rel="' . $context_status_id . '" rev="' . $book->book_id . '">' . $core->books_status[$book->status] . '</a></td>';\r
+                               } else if ($book->status > 1) {\r
+                                       $res .= '<td>' . $core->books_status[1] . '</td>';\r
+                               }\r
                        }\r
                        $res .= '<td class="bouton"><a class="popupFS" rel="toolbar=yes" rev="viewer_' . $book->book_id . '" href="' . SITE_PATH . 'viewer/' . $book->book_id . '_' . $book->hash . '/">' . $btVoir . '</a></td>';\r
                        $res .= '<td class="bouton"><a class="popupFS" rel="toolbar=yes" rev="editor_' . $book->book_id . '" href="' . SITE_PATH . 'editor/' . $book->book_id . '">' . $btEdit . '</a></td>';\r
                        $res .= '<td class="bouton"><a href="' . SITE_PATH . 'stats/' . $book->book_id . '">' . $btStats . '</a></td>';\r
-                       $res .= '<td class="bouton"><a href="#" class="openContextMenu" rel="' . $context_id . '" rev="' . $book->book_id . '">' . $btDownload . '</a></td>';\r
+                       $res .= '<td class="bouton"><a href="#" class="openContextMenu" rel="' . $context_download_id . '" rev="' . $book->book_id . '">' . $btDownload . '</a></td>';\r
                        if ($droits->creation) {\r
                                $res .= '<td class="bouton"><a href="#" rel="supprimeBook/' . $book->book_id . '" class="ajax" title="' . __('Êtes-vous certain de vouloir supprimer cette publication ?') . '">' . $btDel . '</a></td>';\r
                        }\r
@@ -139,6 +145,28 @@ class wsUrl {
                return $res;\r
        }\r
 \r
+       public static function contextBookStatus($id)\r
+       {\r
+               global $core;\r
+\r
+               if (wsDroits::isAdmin()) {\r
+                       $status = $core->books_status;\r
+               } else {\r
+                       $status = array();\r
+                       $status[-1] = $core->books_status[-1];\r
+                       $status[0] = $core->books_status[0];\r
+               }\r
+\r
+               $res = '<div class="contextMenu statusbookContextMenu" id="' . $id . '">';\r
+               $res .= '<ul>';\r
+               $res .= '<li class="head">' . __("Changer le status de la publication") . '</li>';\r
+               foreach($status as $s => $title) {\r
+                       $res .= '<li><a href="#" rel="statusbook/$1/' . $s . '">' . $title . '</a></li>';\r
+               }\r
+               $res .= '</ul></div>';\r
+               return $res;\r
+       }\r
+\r
        public static function traductions($args)\r
        {\r
                global $core;\r
@@ -198,7 +226,8 @@ class wsUrl {
                $res .= '<table class="liste">';\r
                $res .= '<tr><td>' . __('Police de caractères') . ' : </td><td>' . form::hidden('lang', $lang_id) . form::combo('font', self::getFonts(), $lang->font) . '</td></tr>';\r
                $res .= '<tr class="odd"><td>' . __('Jeux de caractères') . ' : </td><td>' . form::combo('charset', self::getCharsets(), $lang->charset) . '</td></tr>';\r
-               $res .= '<tr><td colspan="2" class="right"><a href="#" class="submit">' . $core->typo->Ajouter('Valider') . '</a></td></tr>';\r
+               $res .= '<tr><td>' . __("Langue de l'installeur") . ' : </td><td>' . form::combo('nsis', self::getNSISLangs(), $lang->nsis) . '</td></tr>';\r
+               $res .= '<tr><td colspan="2" class="right odd"><a href="#" class="submit">' . $core->typo->Ajouter('Valider') . '</a></td></tr>';\r
                $res .= '</table>';\r
                $res .= commonPage::bf();\r
 \r
@@ -234,6 +263,23 @@ class wsUrl {
                return $res;\r
        }\r
 \r
+       protected static function getNSISLangs()\r
+       {\r
+               $res = array();\r
+               $dir = WS_FILES . '/nsislangs';\r
+               $dr = opendir($dir);\r
+               while ($file = readdir($dr)) {\r
+                       if ($file == '.' || $file == '..') {\r
+                               continue;\r
+                       }\r
+                       $e = explode('.', $file);\r
+                       $res[$e[0]] = $e[0];\r
+               }\r
+\r
+               ksort($res);\r
+               return $res;\r
+       }\r
+\r
        public static function editor($args)\r
        {\r
                commonDroits::min(1);\r
index 52958bcb998fb4a4923e72b2a0be91bd28321022..d5f9b872025973d9e99d50a9c29fb20a0fdbadeb 100644 (file)
@@ -20,17 +20,22 @@ class wsPackagerWinINST extends wsPackagerWinEXE {
 \r
        protected function makeNSI()\r
        {\r
+               global $core;\r
+\r
                $winvdir = trim($this->vdir, '/');\r
                $winvdir = str_replace('/', '\\' , $winvdir);\r
                $winvdir = "\\" . $winvdir;\r
 \r
+               $daoLang = new wsDAOLang($core->con);\r
+               $lang = $daoLang->selectById($this->book->lang);\r
+\r
                $nsi = file_get_contents(WS_COMPILE_ASSETS . '/script.nsi');\r
                $nsi = str_replace('$name', utf8_decode($this->book->parametres->title), $nsi);\r
                $nsi = str_replace('$htmldir', utf8_decode(WS_COMPILE_ASSETS), $nsi);\r
                $nsi = str_replace('$fname', str_replace('.exe', '', $this->exeName), $nsi);\r
                $nsi = str_replace('$fdir', $winvdir, $nsi);\r
                $nsi = str_replace('$titre', utf8_decode($this->book->parametres->title), $nsi);\r
-               $nsi = str_replace('$lang', 'English', $nsi);\r
+               $nsi = str_replace('$lang', utf8_decode($lang->nsis), $nsi);\r
                $nsi = str_replace('$nsisdir', '/usr/local/nsis/nsis-2.46/share/nsis', $nsi);\r
                $nsi = str_replace('$output', $this->getPathBase('exe'), $nsi);\r
 \r
index 13a0ac2c86bf50e8e25f0cf999d683006af00cfe..c1406c594a0274e2d2a5d0708231b0e7846246b1 100644 (file)
@@ -7,13 +7,18 @@ class wsDAOLang extends commonDAO {
                $lang->font = $r->font;\r
                $lang->charset = $r->charset;\r
 \r
+               if ($r->nsis == '') {\r
+                       $r->nsis = 'English';\r
+               }\r
+               $lang->nsis = $r->nsis;\r
+\r
                if ($r->traductions == '') {\r
                        $lang->traductions = array();\r
                } else {\r
                        $lang->traductions = json_decode($r->traductions, true);\r
                }\r
 \r
-               $lang->traductions=wsLang::checkTranslations($lang->traductions);\r
+               $lang->traductions = wsLang::checkTranslations($lang->traductions);\r
                return $lang;\r
        }\r
 \r
@@ -35,6 +40,7 @@ class wsDAOLang extends commonDAO {
                $c->lang_id = $data['lang_id'];\r
                $c->font = $data['font'];\r
                $c->charset = $data['charset'];\r
+               $c->nsis = $data['nsis'];\r
                $c->traductions = json_encode($data['traductions']);\r
                $r = $this->con->select('SELECT * FROM langues WHERE lang_id=\'' . $this->con->escape($c->lang_id) . '\'');\r
                if (!$r->count()) {\r
index efb8f7c3412f7667f8c7dda92943e18af121c74c..b291a51a660c6dd8d4d6a2689453bd2ebdd01c54 100644 (file)
@@ -69,6 +69,7 @@ class wsLang extends cubeMetier {
        protected $font;\r
        protected $charset;\r
        protected $traductions;\r
+       protected $nsis;\r
 \r
        public static function getTraductionWithId($traductions)\r
        {\r