From: vincent@cubedesigners.com Date: Tue, 12 Oct 2021 14:08:56 +0000 (+0000) Subject: wip #4779 @1 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1f4566a12a229b02800df174b2e26af802027b02;p=cubeextranet.git wip #4779 @1 --- diff --git a/inc/ws/Controlleur/class.ws.maintenance.php b/inc/ws/Controlleur/class.ws.maintenance.php index 33470b80d..564793e85 100644 --- a/inc/ws/Controlleur/class.ws.maintenance.php +++ b/inc/ws/Controlleur/class.ws.maintenance.php @@ -1558,6 +1558,122 @@ class wsMaintenance $dao = new wsDAOTheme($core->con); print_r($dao->selectById('3641')); } + + public static function getAdditionalSettingsMap(): array + { + return ['book_id' => 'book_id', 'lang' => 'lang', 'theme' => 'theme', 'status' => 'status', 'proprietaire_id' => 'owner', 'date' => 'date', 'changedate' => 'changedate', 'wslink' => 'wslink', 'hosting' => 'hosting', 'exportdatas' => 'exportdata']; + } + + public static function getReadonlySettings() + { + return ['book_id', 'date', 'changedate', 'wslink', 'hosting', 'exportdatas']; + } + + + public static function exportPublicationSettings($books = null, $title = 'Settings') + { + + set_time_limit(0); + if (null === $books || !count($books)) { + wsDroits::admin(true); + global $core; + $dao = new wsDAOBook($core->con); + $books = $dao->getListe('book_id', 'DESC'); + } + + $p = new wsBookParametres(new wsBook()); + + $xls = new PHPExcel(); + $sheet = $xls->getActiveSheet(); + $sheet->freezePane('B2'); + $standardSettings = self::getAdditionalSettingsMap(); + $readonlyList = self::getReadonlySettings(); + $j = 0; + foreach ($standardSettings as $column => $label) { + if ($label !== 'exportdata') { + $sheet->getColumnDimensionByColumn($j)->setAutoSize(true); + } + + if (in_array($column, $readonlyList, true)) { + self::_readonlyStyle($sheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($j))); + } + $sheet->setCellValueByColumnAndRow($j, 1, $label); + $j++; + } + $paramCols = []; + foreach ($p->getForms() as $form) { + $form = $p->getForm($form, true); + foreach ($form['fields'] as $k => $field) { + $readonly = false; + if (!$field['editable']) { + $readonly = true; + } + + if ($readonly) { + self::_readonlyStyle($sheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($j))); + } + $sheet->getCommentByColumnAndRow($j, 1)->getText()->createTextRun($field['label']); + $sheet->getColumnDimensionByColumn($j)->setAutoSize(true); + $sheet->setCellValueByColumnAndRow($j, 1, $k); + + $paramCols[] = $k; + $j++; + } + } + + $i = 2; + foreach ($books as $id => $book) { + $j = 0; + foreach ($standardSettings as $column => $label) { + $url = false; + if ($column === 'hosting') { + $export = json_decode($book->exportdatas, true); + if (isset($export['install_hosting']['online']['dir']) && $export['install_hosting']['online']['dir']) { + $val = 'https://hosting.fluidbook.com/' . $export['install_hosting']['online']['dir']; + $url = $val; + } else { + $val = '-'; + } + } else if ($column === 'wslink') { + $val = 'https://workshop.fluidbook.com/viewerh/' . $id . '_' . $book->hash . '/'; + } else { + $val = $book->$column; + } + if (strpos($column, 'date') !== false) { + $val = date('Y-m-d', $val); + } + $sheet->setCellValueByColumnAndRow($j, $i, $val); + if ($url) { + $sheet->getCellByColumnAndRow($j, $i)->getHyperlink()->setUrl($url); + } + + $j++; + } + foreach ($paramCols as $col) { + $sheet->setCellValueByColumnAndRow($j, $i, $book->parametres->$col); + $j++; + } + $i++; + } + ob_end_clean(); + header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); + header('Content-Disposition: attachment; filename="' . CubeIT_Text::str2URL($title) . '.xlsx"'); + $writer = new PHPExcel_Writer_Excel2007($xls); + $writer->save('php://output'); + exit; + } + + + /** + * @param $style PHPExcel_Style + */ + protected static function _readonlyStyle($style) + { + $style->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setRGB('DDDDDD'); + $style->getFont()->getColor()->setRGB('666666'); + } + + } diff --git a/inc/ws/Controlleur/class.ws.url.php b/inc/ws/Controlleur/class.ws.url.php index d00c59575..a9e77ba84 100644 --- a/inc/ws/Controlleur/class.ws.url.php +++ b/inc/ws/Controlleur/class.ws.url.php @@ -2005,16 +2005,6 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co header('Location: https://www.orpi.com/'); } - public static function getAdditionalSettingsMap(): array - { - return ['book_id' => 'book_id', 'lang' => 'lang', 'theme' => 'theme', 'status' => 'status', 'proprietaire_id' => 'owner', 'date' => 'date', 'changedate' => 'changedate', 'wslink' => 'wslink', 'hosting' => 'hosting', 'exportdatas' => 'exportdata']; - } - - public static function getReadonlySettings() - { - return ['book_id', 'date', 'changedate', 'wslink', 'hosting', 'exportdatas']; - } - public static function exportPublicationSettings($args) { global $core; @@ -2024,94 +2014,7 @@ html,body{height:100%;cursor: wait;font-family: "Open Sans", Arial;background-co $books = wsUrl::listeBooks($r->dashboard_id, commonUrl::getDashboardSettings($r->settings), true); } - $p = new wsBookParametres(new wsBook()); - - $xls = new PHPExcel(); - $sheet = $xls->getActiveSheet(); - $sheet->freezePane('B2'); - $standardSettings = self::getAdditionalSettingsMap(); - $readonlyList = self::getReadonlySettings(); - $j = 0; - foreach ($standardSettings as $column => $label) { - if ($label !== 'exportdata') { - $sheet->getColumnDimensionByColumn($j)->setAutoSize(true); - } - - if (in_array($column, $readonlyList, true)) { - self::_readonlyStyle($sheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($j))); - } - $sheet->setCellValueByColumnAndRow($j, 1, $label); - $j++; - } - $paramCols = []; - foreach ($p->getForms() as $form) { - $form = $p->getForm($form, true); - foreach ($form['fields'] as $k => $field) { - $readonly = false; - if (!$field['editable']) { - $readonly = true; - } - - if ($readonly) { - self::_readonlyStyle($sheet->getStyle(PHPExcel_Cell::stringFromColumnIndex($j))); - } - $sheet->getCommentByColumnAndRow($j, 1)->getText()->createTextRun($field['label']); - $sheet->getColumnDimensionByColumn($j)->setAutoSize(true); - $sheet->setCellValueByColumnAndRow($j, 1, $k); - - $paramCols[] = $k; - $j++; - } - } - - $i = 2; - foreach ($books as $id => $book) { - $j = 0; - foreach ($standardSettings as $column => $label) { - $url = false; - if ($column === 'hosting') { - $export = json_decode($book->exportdatas, true); - if (isset($export['install_hosting']['online']['dir']) && $export['install_hosting']['online']['dir']) { - $val = 'https://hosting.fluidbook.com/' . $export['install_hosting']['online']['dir']; - $url = $val; - } else { - $val = '-'; - } - } else if ($column === 'wslink') { - $val = 'https://workshop.fluidbook.com/viewerh/' . $id . '_' . $book->hash . '/'; - } else { - $val = $book->$column; - } - if (strpos($column, 'date') !== false) { - $val = date('Y-m-d', $val); - } - $sheet->setCellValueByColumnAndRow($j, $i, $val); - if ($url) { - $sheet->getCellByColumnAndRow($j, $i)->getHyperlink()->setUrl($url); - } - - $j++; - } - foreach ($paramCols as $col) { - $sheet->setCellValueByColumnAndRow($j, $i, $book->parametres->$col); - $j++; - } - $i++; - } - ob_end_clean(); - header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'); - header('Content-Disposition: attachment; filename="' . CubeIT_Text::str2URL($title) . '.xlsx"'); - $writer = new PHPExcel_Writer_Excel2007($xls); - $writer->save('php://output'); - exit; + wsMaintenance::exportPublicationSettings($books,$title); } - /** - * @param $style PHPExcel_Style - */ - protected static function _readonlyStyle($style) - { - $style->getFill()->setFillType(PHPExcel_Style_Fill::FILL_SOLID)->getStartColor()->setRGB('DDDDDD'); - $style->getFont()->getColor()->setRGB('666666'); - } -} +} \ No newline at end of file diff --git a/inc/ws/Metier/class.ws.book.parametres.php b/inc/ws/Metier/class.ws.book.parametres.php index 53cee12f3..14d50f6b9 100644 --- a/inc/ws/Metier/class.ws.book.parametres.php +++ b/inc/ws/Metier/class.ws.book.parametres.php @@ -637,6 +637,11 @@ class wsBookParametres extends wsParametres 'fieldsnames' => ['audiodescriptionTexts', 'audiodescriptionVoice'] ]; + // Tooltip + + + // Splashscreen + $this->fields['splashImage'] = ['type' => 'freefile', 'default' => '', 'editable' => true, 'label' => __('Image'), 'grade' => 3, 'fileFilter' => $imageFilter]; $this->fields['splashURL'] = ['type' => 'text', 'default' => '', 'editable' => true, 'label' => __('URL'), 'grade' => 3]; $this->fields['splashTarget'] = ['type' => 'combo', 'datas' => $target, 'default' => '_self', 'editable' => true, 'label' => __('Ouvrir le lien'), 'grade' => 3]; diff --git a/inc/ws/Metier/class.ws.theme.parametres.php b/inc/ws/Metier/class.ws.theme.parametres.php index 996a6a8b2..3b9382438 100644 --- a/inc/ws/Metier/class.ws.theme.parametres.php +++ b/inc/ws/Metier/class.ws.theme.parametres.php @@ -97,6 +97,8 @@ class wsThemeParametres extends wsParametres 'label' => __("Couleur du texte des infobulles")); $this->fields['tooltipTextSize'] = array('type' => 'integer', 'default' => 100, 'editable' => true, 'label' => __('Taille du texte des infobulles')); + $this->fields['tooltipPaddingSize'] = array('type' => 'integer', 'default' => 20, 'editable' => true, + 'label' => __('Marge intérieure des infobulles')); $this->fields['bookmarkBackgroundColor'] = array('type' => 'couleurAlpha', 'default' => 'ffadadad', 'editable' => true, 'label' => __("Couleur de fond des marques-pages")); $this->fields['bookmarkStarDisabledColor'] = array('type' => 'couleurAlpha', 'default' => '00ffffff', 'editable' => true, @@ -109,7 +111,7 @@ class wsThemeParametres extends wsParametres '|', 'bookShadeColor', '|', 'usePageEdges', '|', 'displayPageNumber', 'colorPageNumber', '|', 'linksColor', 'videoBackgroundColor', - '|', 'tooltipBackColor', 'tooltipTextColor', 'tooltipTextSize', + '|', 'tooltipBackColor', 'tooltipTextColor', 'tooltipTextSize','tooltipPaddingSize', '|', 'bookmarkBackgroundColor', 'bookmarkStarDisabledColor', 'bookmarkStarEnabledColor')); /* Credits */ $this->fields['creditsColor'] = array('type' => 'couleurAlpha', 'default' => '80ffffff', 'editable' => true,