From: vincent@cubedesigners.com Date: Tue, 8 Feb 2011 15:46:38 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=9fcaee2a5283eed7b794e61f284141bb5ba7f4d6;p=cubeextranet.git --- diff --git a/inc/commons/class.common.core.php b/inc/commons/class.common.core.php index a4412e257..15194ea23 100644 --- a/inc/commons/class.common.core.php +++ b/inc/commons/class.common.core.php @@ -200,7 +200,7 @@ class commonCore extends cubeCore { $db->projets->primary('pk_projets', 'projet_id'); $db->projets->index('index_projets_status', 'BTREE', 'status'); $db->projets->index('index_projets_nom', 'BTREE', 'nom'); - //$db->projets->reference('fk_projets_client', 'client', 'utilisateurs', 'utilisateur_id', false, false); + // $db->projets->reference('fk_projets_client', 'client', 'utilisateurs', 'utilisateur_id', false, false); $db->projets->reference('fk_projets_chef', 'chef', 'utilisateurs', 'utilisateur_id', false, false); // . // Table taches @@ -213,7 +213,7 @@ class commonCore extends cubeCore { $db->taches->projet('integer', 0, false); // Clés $db->taches->primary('pk_taches', 'tache_id'); - //$db->taches->reference('fk_taches_projet', 'projet', 'projets', 'projet_id'); + // $db->taches->reference('fk_taches_projet', 'projet', 'projets', 'projet_id'); $db->taches->index('index_taches_nom', 'BTREE', 'nom'); $db->taches->index('index_taches_categorie', 'BTREE', 'categorie'); // . @@ -264,7 +264,7 @@ class commonCore extends cubeCore { $db->factures->primary('pk_factures', 'facture_id'); $db->factures->index('index_factures_status', 'BTREE', 'status'); $db->factures->index('index_factures_nom', 'BTREE', 'nom'); - //$db->factures->reference('fk_factures_projet', 'projet', 'projets', 'projet_id'); + // $db->factures->reference('fk_factures_projet', 'projet', 'projets', 'projet_id'); $db->factures->reference('fk_factures_createur', 'createur', 'utilisateurs', 'utilisateur_id'); // . // Table dashboard @@ -325,6 +325,7 @@ class commonCore extends cubeCore { $db->langues->font('varchar', 64, false); $db->langues->charset('varchar', 64, false); $db->langues->traductions('text', 0, false); + $db->langues->nsis('varchar', 64, false); // Clés $db->langues->primary('pk_langues', 'lang_id'); // . @@ -346,7 +347,7 @@ class commonCore extends cubeCore { $db->documents->index('index_documents_file', 'BTREE', 'file'); $db->documents->index('index_documents_date', 'BTREE', 'date'); $db->documents->index('index_documents_localHash', 'BTREE', 'localHash'); - //$db->documents->reference('fk_documents_proprietaire', 'proprietaire', 'utilisateurs', 'utilisateur_id'); + // $db->documents->reference('fk_documents_proprietaire', 'proprietaire', 'utilisateurs', 'utilisateur_id'); // . // Table pages des documents $db->document_links->document_id('integer', 0, false); diff --git a/inc/ws/Controlleur/class.ws.ajax.php b/inc/ws/Controlleur/class.ws.ajax.php index bbda3a668..e49fbf561 100644 --- a/inc/ws/Controlleur/class.ws.ajax.php +++ b/inc/ws/Controlleur/class.ws.ajax.php @@ -243,6 +243,7 @@ class wsAjax extends cubeAjax { $data['font'] = $_POST['font']; $data['charset'] = $_POST['charset']; $data['traductions'] = $_POST['msgid']; + $data['nsis'] = $_POST['nsis']; $dao->sauve($data); $x->addAlert(__('Paramètres de la langue et traductions enregistrées')); } @@ -328,7 +329,7 @@ class wsAjax extends cubeAjax { 'detail' => 'Commentaires'); $mail = new cubeMail(); $mail->charset = 'UTF-8'; - $mail->from = $_POST['prenom'] . ' ' . $_POST['nom']; + $mail->from = $_POST['prenom'] . ' ' . $_POST['nom'] . '<' . $_POST['email'] . '>'; $mail->to = FROM_EMAIL; $mail->subject = '[' . EMAIL_SUBJECT . '] Demande de devis'; $body = 'Une demande de devis a été envoyée avec les informations suivantes :' . "\r\n\r\n"; diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index e4b3de717..580bf965d 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -40,7 +40,8 @@ class wsUrl { $settings = is_null($settings)?$core->user->getSettings('books'):$settings; $change = is_null($dashboard)?'Books':'Dashboard/' . $dashboard; $dao = new wsDAOBook($core->con); - $context_id = is_null($dashboard)?'contextBook':'contextDashboard_' . $dashboard; + $context_download_id = is_null($dashboard)?'contextDownloadBook':'contextDashboard_Download' . $dashboard; + $context_status_id = is_null($dashboard)?'contextStatusBook':'contextDashboard_Status' . $dashboard; if (isset($settings['search']) && !is_null($settings['search'])) { $dao->setSearch($settings['search']); @@ -48,7 +49,8 @@ class wsUrl { $dao->setFiltres($settings['filtres']); $liste = $dao->getListe($settings['orderby'], $settings['sens'], $settings['limit'], $core->user); - $res = self::contextBookDownload($context_id); + $res = self::contextBookDownload($context_download_id); + $res = self::contextBookStatus($context_status_id); $res .= ''; $res .= ''; @@ -95,12 +97,16 @@ class wsUrl { $res .= ''; } if ($droits->revendeur) { - $res .= ''; + if ($droits->admin || $book->status <= 1) { + $res .= ''; + } else if ($book->status > 1) { + $res .= ''; + } } $res .= ''; $res .= ''; $res .= ''; - $res .= ''; + $res .= ''; if ($droits->creation) { $res .= ''; } @@ -139,6 +145,28 @@ class wsUrl { return $res; } + public static function contextBookStatus($id) + { + global $core; + + if (wsDroits::isAdmin()) { + $status = $core->books_status; + } else { + $status = array(); + $status[-1] = $core->books_status[-1]; + $status[0] = $core->books_status[0]; + } + + $res = '
'; + $res .= '
'; + return $res; + } + public static function traductions($args) { global $core; @@ -198,7 +226,8 @@ class wsUrl { $res .= '
' . commonUrl::orderby('#', 'book_id', $settings, 'sort' . $change) . '' . $book->facturable . '' . $core->books_status[$book->status] . '' . $core->books_status[$book->status] . '' . $core->books_status[1] . '' . $btVoir . '' . $btEdit . '' . $btStats . '' . $btDownload . '' . $btDownload . '' . $btDel . '
'; $res .= ''; $res .= ''; - $res .= ''; + $res .= ''; + $res .= ''; $res .= '
' . __('Police de caractères') . ' : ' . form::hidden('lang', $lang_id) . form::combo('font', self::getFonts(), $lang->font) . '
' . __('Jeux de caractères') . ' : ' . form::combo('charset', self::getCharsets(), $lang->charset) . '
' . $core->typo->Ajouter('Valider') . '
' . __("Langue de l'installeur") . ' : ' . form::combo('nsis', self::getNSISLangs(), $lang->nsis) . '
' . $core->typo->Ajouter('Valider') . '
'; $res .= commonPage::bf(); @@ -234,6 +263,23 @@ class wsUrl { return $res; } + protected static function getNSISLangs() + { + $res = array(); + $dir = WS_FILES . '/nsislangs'; + $dr = opendir($dir); + while ($file = readdir($dr)) { + if ($file == '.' || $file == '..') { + continue; + } + $e = explode('.', $file); + $res[$e[0]] = $e[0]; + } + + ksort($res); + return $res; + } + public static function editor($args) { commonDroits::min(1); diff --git a/inc/ws/Controlleur/packager/class.ws.packager.win.inst.php b/inc/ws/Controlleur/packager/class.ws.packager.win.inst.php index 52958bcb9..d5f9b8720 100644 --- a/inc/ws/Controlleur/packager/class.ws.packager.win.inst.php +++ b/inc/ws/Controlleur/packager/class.ws.packager.win.inst.php @@ -20,17 +20,22 @@ class wsPackagerWinINST extends wsPackagerWinEXE { protected function makeNSI() { + global $core; + $winvdir = trim($this->vdir, '/'); $winvdir = str_replace('/', '\\' , $winvdir); $winvdir = "\\" . $winvdir; + $daoLang = new wsDAOLang($core->con); + $lang = $daoLang->selectById($this->book->lang); + $nsi = file_get_contents(WS_COMPILE_ASSETS . '/script.nsi'); $nsi = str_replace('$name', utf8_decode($this->book->parametres->title), $nsi); $nsi = str_replace('$htmldir', utf8_decode(WS_COMPILE_ASSETS), $nsi); $nsi = str_replace('$fname', str_replace('.exe', '', $this->exeName), $nsi); $nsi = str_replace('$fdir', $winvdir, $nsi); $nsi = str_replace('$titre', utf8_decode($this->book->parametres->title), $nsi); - $nsi = str_replace('$lang', 'English', $nsi); + $nsi = str_replace('$lang', utf8_decode($lang->nsis), $nsi); $nsi = str_replace('$nsisdir', '/usr/local/nsis/nsis-2.46/share/nsis', $nsi); $nsi = str_replace('$output', $this->getPathBase('exe'), $nsi); diff --git a/inc/ws/DAO/class.ws.dao.lang.php b/inc/ws/DAO/class.ws.dao.lang.php index 13a0ac2c8..c1406c594 100644 --- a/inc/ws/DAO/class.ws.dao.lang.php +++ b/inc/ws/DAO/class.ws.dao.lang.php @@ -7,13 +7,18 @@ class wsDAOLang extends commonDAO { $lang->font = $r->font; $lang->charset = $r->charset; + if ($r->nsis == '') { + $r->nsis = 'English'; + } + $lang->nsis = $r->nsis; + if ($r->traductions == '') { $lang->traductions = array(); } else { $lang->traductions = json_decode($r->traductions, true); } - $lang->traductions=wsLang::checkTranslations($lang->traductions); + $lang->traductions = wsLang::checkTranslations($lang->traductions); return $lang; } @@ -35,6 +40,7 @@ class wsDAOLang extends commonDAO { $c->lang_id = $data['lang_id']; $c->font = $data['font']; $c->charset = $data['charset']; + $c->nsis = $data['nsis']; $c->traductions = json_encode($data['traductions']); $r = $this->con->select('SELECT * FROM langues WHERE lang_id=\'' . $this->con->escape($c->lang_id) . '\''); if (!$r->count()) { diff --git a/inc/ws/Metier/class.ws.lang.php b/inc/ws/Metier/class.ws.lang.php index efb8f7c34..b291a51a6 100644 --- a/inc/ws/Metier/class.ws.lang.php +++ b/inc/ws/Metier/class.ws.lang.php @@ -69,6 +69,7 @@ class wsLang extends cubeMetier { protected $font; protected $charset; protected $traductions; + protected $nsis; public static function getTraductionWithId($traductions) {