diff --git a/www/client/answer.php b/www/client/answer.php index a8e9625c0e..de461a1fc7 100644 --- a/www/client/answer.php +++ b/www/client/answer.php @@ -32,17 +32,17 @@ if (!isset($parm)) $request = http_request::getInstance(); $parm = $request->get_parms("mod", "bas" - , "pag" - , "qry", "search_type", "recordtype" - , "qryAdv", 'opAdv', 'status', 'datemin', 'datemax' + , "pag" + , "qry", "search_type", "recordtype" + , "qryAdv", 'opAdv', 'status', 'datemin', 'datemax' , 'dateminfield', 'datemaxfield' , 'datefield' , 'sort' , 'stemme' , 'infield' - , "nba" - , "regroup" // si rech par doc, regroup ,ou pizza - , "ord" + , "nba" + , "regroup" // si rech par doc, regroup ,ou pizza + , "ord" ); } $qry = ''; @@ -148,157 +148,157 @@ $page = $result->get_current_page(); $ACL = $user->ACL(); - if ($registry->get('GV_thesaurus')) - { -?> - -$("#history").empty().append("' . str_replace('"', '\"', $history) . '")'; - - $nbanswers = $result->get_count_available_results(); - $longueur = strlen($parm['qry']); - - $qrys = '
' . _('client::answers: rapport de questions par bases') . '
'; - - foreach ($qrySbas as $sbas => $qryBas) - $qrys .= '
' . phrasea::sbas_names($sbas) . '
' . $qryBas . '
'; - - $txt = "" . substr($parm['qry'], 0, 36) . ($longueur > 36 ? "..." : "") . "" . sprintf(_('client::answers: %d reponses'), (int) $nbanswers) . "  "; -?> - + $("#history").empty().append("' . str_replace('"', '\"', $history) . '")'; + +$nbanswers = $result->get_count_available_results(); +$longueur = strlen($parm['qry']); + +$qrys = '
' . _('client::answers: rapport de questions par bases') . '
'; + +foreach ($qrySbas as $sbas => $qryBas) + $qrys .= '
' . phrasea::sbas_names($sbas) . '
' . $qryBas . '
'; + +$txt = "" . substr($parm['qry'], 0, 36) . ($longueur > 36 ? "..." : "") . "" . sprintf(_('client::answers: %d reponses'), (int) $nbanswers) . "  "; +?> + get_total_pages(); - $pages = ''; - $ecart = 3; - $max = (2 * $ecart) + 3; +$pages = ''; +$ecart = 3; +$max = (2 * $ecart) + 3; - if ($npages > $max) +if ($npages > $max) +{ + for ($p = 0; $p < $npages; $p++) { - for ($p = 0; $p < $npages; $p++) - { - if ($p == $page) - $pages .= '' . ($p + 1) . ''; - elseif (( $p >= ($page - $ecart) ) && ( $p <= ($page + $ecart) )) - $pages .= '' . ($p + 1) . ''; - elseif (($page < ($ecart + 2)) && ($p < ($max - $ecart + 2) )) // si je suis dans les premieres pages ... - $pages .= '' . ($p + 1) . ''; - elseif (($page >= ($npages - $ecart - 2)) && ($p >= ($npages - (2 * $ecart) - 2) )) // si je suis dans les dernieres pages ... - $pages .= '' . ($p + 1) . ''; - elseif ($p == ($npages - 1)) // c"est la derniere - $pages .= '...' . ($p + 1) . ''; - elseif ($p == 0) // c"est la premiere - $pages .= '' . ($p + 1) . '...'; + if ($p == $page) + $pages .= '' . ($p + 1) . ''; + elseif (( $p >= ($page - $ecart) ) && ( $p <= ($page + $ecart) )) + $pages .= '' . ($p + 1) . ''; + elseif (($page < ($ecart + 2)) && ($p < ($max - $ecart + 2) )) // si je suis dans les premieres pages ... + $pages .= '' . ($p + 1) . ''; + elseif (($page >= ($npages - $ecart - 2)) && ($p >= ($npages - (2 * $ecart) - 2) )) // si je suis dans les dernieres pages ... + $pages .= '' . ($p + 1) . ''; + elseif ($p == ($npages - 1)) // c"est la derniere + $pages .= '...' . ($p + 1) . ''; + elseif ($p == 0) // c"est la premiere + $pages .= '' . ($p + 1) . '...'; - if (($p == $page) - || ( ( $p >= ($page - $ecart) ) && ( $p <= ($page + $ecart) )) - || ( ($page < ($ecart + 2)) && ($p < ($max - $ecart + 2) ) ) - || ( ($page >= ($npages - $ecart - 2)) && ($p >= ($npages - (2 * $ecart) - 2) ) ) - || ( $p == 0) - ) - $pages .= ' - '; - } + if (($p == $page) + || ( ( $p >= ($page - $ecart) ) && ( $p <= ($page + $ecart) )) + || ( ($page < ($ecart + 2)) && ($p < ($max - $ecart + 2) ) ) + || ( ($page >= ($npages - $ecart - 2)) && ($p >= ($npages - (2 * $ecart) - 2) ) ) + || ( $p == 0) + ) + $pages .= ' - '; } - else +} +else +{ + for ($p = 0; $p < $npages; $p++) { - for ($p = 0; $p < $npages; $p++) - { - if ($p == $page) - $pages .= '' . ($p + 1) . ''; - else - $pages .= '' . ($p + 1) . ''; - if ($p + 1 < $npages) - $pages .= ' - '; - } + if ($p == $page) + $pages .= '' . ($p + 1) . ''; + else + $pages .= '' . ($p + 1) . ''; + if ($p + 1 < $npages) + $pages .= ' - '; } +} - $string2 = $pages . ''; +$string2 = $pages . ''; ?> - +}); + get_datas(); +$count = $result->get_datas(); - $i = 0; +$i = 0; - if (count($result->get_datas()) > 0) +if (count($result->get_datas()) > 0) +{ + ?>
addFilter(array('formatoctet'=>'p4string::format_octets')); + $core = \bootstrap::getCore(); + $twig = $core->getTwig(); foreach ($result->get_datas() as $record) { @@ -317,192 +317,194 @@ $npages = $result->get_total_pages(); if ($i == 0) { -?> - - + + -


-
+
'; - $status .= $record->get_status_icons(); - $status .= '
'; + $status = ''; + $status .= '
'; + $status .= $record->get_status_icons(); + $status .= '
'; - echo $status; + echo $status; - $isVideo = ($docType == 'video'); - $isAudio = ($docType == 'audio'); - $isImage = ($docType == 'image'); - $isDocument = ($docType == 'document'); + $isVideo = ($docType == 'video'); + $isAudio = ($docType == 'audio'); + $isImage = ($docType == 'image'); + $isDocument = ($docType == 'document'); - $sd = $record->get_subdefs(); - - $isImage = false; - $isDocument = false; - if (!$isVideo && !$isAudio) + $sd = $record->get_subdefs(); + + $isImage = false; + $isDocument = false; + if (!$isVideo && !$isAudio) + { + $isImage = true; + } + + ?> - -
get_formated_duration(); + if ($duration != '') + echo '
' . $duration . '
'; + } + if ($isAudio) + { + $duration = $record->get_formated_duration(); + if ($duration != '') + echo '
' . $duration . '
'; } -?> + +
is_grouping()) + { + $onclick = 'openPreview(\'REG\',0,\'' . $sbas_id . '_' . $record->get_record_id() . '\');'; + } + else + { + $onclick = 'openPreview(\'RESULT\',' . $record->get_number() . ');'; + } + + if ($mod_col == '1') + $pic_roll = '/prod/tooltip/preview/' . $record->get_sbas_id() . '/' . $record->get_record_id() . '/'; + else + $pic_roll = '/prod/tooltip/caption/' . $record->get_sbas_id() . '/' . $record->get_record_id() . '/answer/'; + + $pic_roll = str_replace(array('&', '"'), array('&', '"'), $pic_roll); + ?> +
+ +
' . collection::getLogo($record->get_base_id()); + $minilogos .= '
'; + $sbas_id = $record->get_sbas_id(); + echo $minilogos; + + if ( + $ACL->has_right_on_base($record->get_base_id(), 'candwnldpreview') || + $ACL->has_right_on_base($record->get_base_id(), 'candwnldhd') || + $ACL->has_right_on_base($record->get_base_id(), 'cancmd') + ) { - $duration = $record->get_formated_duration(); - if ($duration != '') - echo '
' . $duration . '
'; - } - if ($isAudio) - { - $duration = $record->get_formated_duration(); - if ($duration != '') - echo '
' . $duration . '
'; - } - - $onclick = ""; - - if ($record->is_grouping()) - { - $onclick = 'openPreview(\'REG\',0,\'' . $sbas_id . '_' . $record->get_record_id() . '\');'; - } - else - { - $onclick = 'openPreview(\'RESULT\',' . $record->get_number() . ');'; - } - - if ($mod_col == '1') - $pic_roll = '/prod/tooltip/preview/'.$record->get_sbas_id().'/'.$record->get_record_id().'/'; - else - $pic_roll = '/prod/tooltip/caption/'.$record->get_sbas_id().'/'.$record->get_record_id().'/answer/'; - - $pic_roll = str_replace(array('&', '"'), array('&', '"'), $pic_roll); -?> -
- -
' . collection::getLogo($record->get_base_id()); - $minilogos .= '
'; - $sbas_id = $record->get_sbas_id(); - echo $minilogos; - - if ( - $ACL->has_right_on_base($record->get_base_id(), 'candwnldpreview') || - $ACL->has_right_on_base($record->get_base_id(), 'candwnldhd') || - $ACL->has_right_on_base($record->get_base_id(), 'cancmd') - ) - { -?>
+ ?>
- has_right_on_base($record->get_base_id(), "canputinalbum")) { - ?>
+ ?>
- get_preview()->is_physically_present()) + if ($record->get_preview()->is_physically_present()) { - ?> + ?>
 
-
' . $light_info) ?>
- -
' . $light_info) ?>
+ + +
'; + $b = true; + foreach ($proposals["BASES"] as $zbase) + { + if ((int) (count($proposals["BASES"]) > 1) && count($zbase["TERMS"]) > 0) + { + $style = $b ? 'style="margin-top:0px;"' : ''; + $b = false; + $html .= "

" . sprintf(_('reponses::propositions pour la base %s'), htmlentities($zbase["NAME"])) . "

"; + } + $t = true; + foreach ($zbase["TERMS"] as $path => $props) + { + $style = $t ? 'style="margin-top:0px;"' : ''; + $t = false; + $html .= "

" . sprintf(_('reponses::propositions pour le terme %s'), htmlentities($props["TERM"])) . "

"; + $html .= $props["HTML"]; + } + } + $html .= ''; + + return($html); +} diff --git a/www/client/clientFeedBack.php b/www/client/clientFeedBack.php index 77fdda41ab..6fd3297259 100644 --- a/www/client/clientFeedBack.php +++ b/www/client/clientFeedBack.php @@ -39,7 +39,9 @@ switch ($parm['action']) $output = module_client::getLanguage($lng); break; case 'PREVIEW': - $twig = new supertwig(); + + $core = \bootstrap::getCore(); + $twig = $core->getTwig(); $search_engine = null; if (($options = unserialize($parm['options_serial'])) !== false) @@ -50,8 +52,6 @@ switch ($parm['action']) $record = new record_preview($parm['env'], $parm['pos'], $parm['cont'], $parm['roll'], $search_engine, $parm['query']); - $twig->addFilter(array('implode' => 'implode', 'formatoctet'=>'p4string::format_octets')); - $train = ''; if ($record->is_from_reg()) diff --git a/www/client/homeinterpubbask.php b/www/client/homeinterpubbask.php index 522e18509b..eaad0001e9 100644 --- a/www/client/homeinterpubbask.php +++ b/www/client/homeinterpubbask.php @@ -62,8 +62,8 @@ if ($rawMe) $info_usr = $rawMe; } -$twig = new supertwig(); -$twig->addFilter(array('formatoctet'=>'p4string::format_octets')); +$core = \bootstrap::getCore(); +$twig = $core->getTwig(); $stmt = $conn->prepare($sql); $usr_id = $session->get_usr_id(); @@ -173,7 +173,7 @@ foreach ($rs as $row) } catch (Exception $e) { - + } } @@ -202,7 +202,7 @@ foreach ($rs as $row) if (trim($preview) != '') - $preview = "
 "; + $preview = "
 "; $docType = $record->get_type(); $isVideo = ($docType == 'video'); diff --git a/www/client/index.php b/www/client/index.php index d6e3cd5612..7133fbb347 100644 --- a/www/client/index.php +++ b/www/client/index.php @@ -57,117 +57,118 @@ $user = User_Adapter::getInstance($usr_id, $appbox); -get('GV_RootPath') . 'www/skins/client/'; + $css = array(); + $cssPath = $registry->get('GV_RootPath') . 'www/skins/client/'; -if ($hdir = opendir($cssPath)) -{ - while (false !== ($file = readdir($hdir))) - { - - if (substr($file, 0, 1) == "." || mb_strtolower($file) == "cvs") - continue; - if (is_dir($cssPath . $file)) + if ($hdir = opendir($cssPath)) { - $css[$file] = $file; + while (false !== ($file = readdir($hdir))) + { + + if (substr($file, 0, 1) == "." || mb_strtolower($file) == "cvs") + continue; + if (is_dir($cssPath . $file)) + { + $css[$file] = $file; + } + } + closedir($hdir); } - } - closedir($hdir); -} -$cssfile = false; -$baskStatus = '1'; -$mode_pres = ''; + $cssfile = false; + $baskStatus = '1'; + $mode_pres = ''; -$cssfile = $user->getPrefs('client_css'); -$baskStatus = $user->getPrefs('client_basket_status'); -$mode_pres = $user->getPrefs('client_view'); -$start_page = $user->getPrefs('start_page'); -$start_page_query = $user->getPrefs('start_page_query'); + $cssfile = $user->getPrefs('client_css'); + $baskStatus = $user->getPrefs('client_basket_status'); + $mode_pres = $user->getPrefs('client_view'); + $start_page = $user->getPrefs('start_page'); + $start_page_query = $user->getPrefs('start_page_query'); -if (!$cssfile && isset($css['000000'])) - $cssfile = '000000'; + if (!$cssfile && isset($css['000000'])) + $cssfile = '000000'; -$cssfile = 'skins/client/000000/clientcolor.css'; -?> + $cssfile = 'skins/client/000000/clientcolor.css'; + ?> - - - + + +
-display('common/menubar.twig', array('module' => 'client', 'events' => $events_mngr)); -?> + $core = \bootstrap::getCore(); + $twig = $core->getTwig(); + echo $twig->render('common/menubar.twig', array('module' => 'client', 'events' => $events_mngr)); + ?>
-get('GV_client_coll_ckbox') === 'popup') - { - // liste des collections : popup -?> -
- - - -get_databoxes()) > 0); - $options = ''; - - - - foreach ($appbox->get_databoxes() as $databox) + get('GV_client_coll_ckbox') === 'popup') { - if ($showbases) - { - $options .= ''; - $allbcol = array(); - $n_allbcol = 0; - if (count($databox->get_collections()) > 0) - { - $options .= ''; - } - foreach ($databox->get_collections() as $coll) - { - $allbcol[] = $coll->get_base_id(); - $n_allbcol++; + // liste des collections : popup + ?> +
+ - echo ''; - $options .= ''; + get_databoxes()) > 0); + $options = ''; - $allbases[] = $coll->get_base_id(); - } - if ($n_allbcol > 1) + + + foreach ($appbox->get_databoxes() as $databox) { - $options .= ''; + if ($showbases) + { + $options .= ''; + $allbcol = array(); + $n_allbcol = 0; + if (count($databox->get_collections()) > 0) + { + $options .= ''; + } + foreach ($databox->get_collections() as $coll) + { + $allbcol[] = $coll->get_base_id(); + $n_allbcol++; + + echo ''; + + $options .= ''; + + $allbases[] = $coll->get_base_id(); + } + if ($n_allbcol > 1) + { + $options .= ''; + } + } + if ($showbases) + { + $options .= "\n"; + } } - } - if ($showbases) - { - $options .= "\n"; - } + echo ''; + ?> +
+ ' . $options . ''; -?> -
- + ?>
-get('GV_defaultQuery_type') == 0 ? $sel1 = " checked='checked'" : $sel2 = " checked='checked'") -?> + get('GV_defaultQuery_type') == 0 ? $sel1 = " checked='checked'" : $sel2 = " checked='checked'") + ?> id="search_type_docs" name="search_type" /> id="search_type_group" name="search_type" /> @@ -306,461 +307,461 @@ if ($cssfile)
-get('GV_client_coll_ckbox') == 'checkbox') - { -?> - - - -get('GV_thesaurus')) - { -?> - actives" onclick="chgOng(4);"> - - - - - + get('GV_client_coll_ckbox') == 'checkbox') + { + ?> + + -
+ get('GV_thesaurus')) + { + ?> + actives" onclick="chgOng(4);"> + + + + + +
-
-get('GV_client_coll_ckbox') == 'checkbox') - { -?> -
-
-
- - -
+
+
+ get('GV_client_coll_ckbox') == 'checkbox') + { + ?> +
+
+
+ + +
-
-
-
-get_databoxes() as $databox) - { - if ($registry->get('GV_view_bas_and_coll')) +
+
+
+ get_databoxes() as $databox) { -?> -
-
-
- - - -
-get_sbas_id()); - - $sbFilters = ''; - $dateFilters = $fieldsFilters = ''; - foreach ($status as $bit => $datas) + if ($registry->get('GV_view_bas_and_coll')) { - $imgoff = ''; - $imgon = ''; + ?> +
+
+
+ + + +
+ get_sbas_id()); - if ($datas['img_off']) - $imgoff = ''; - - if ($datas['img_on']) - $imgoff = ''; - - $labeloff = $datas['labeloff']; - $labelon = $datas['labelon']; - - $sbFilters .= '
' . - '' . - '' . - '' . - '' . - '' . - '
' . - '' . - '' . - '' . - '' . - '' . - '
' . - '
'; - } - - $sxe = $databox->get_sxml_structure(); - if ($sxe) - { - $sbFilters = ''; - $dateFilters = $fieldsFilters = ''; - if ($sxe->statbits->bit) - { - foreach ($sxe->statbits->bit as $sb) - { - if ($sb['searchclient'] && $sb['searchclient'] == '1') + $sbFilters = ''; + $dateFilters = $fieldsFilters = ''; + foreach ($status as $bit => $datas) { - - - $sb_pathOff = '/status/' . $databox->get_host() . "-" . $databox->get_port() . "-" . $databox->get_dbname() . '-' . 'stat_' . $sb['n'] . '_0.gif'; - $sb_pathOn = '/status/' . $databox->get_host() . "-" . $databox->get_port() . "-" . $databox->get_dbname() . '-' . 'stat_' . $sb['n'] . '_1.gif'; - $imgoff = ''; $imgon = ''; - if (is_file($registry->get('GV_RootPath') . 'config/' . $sb_pathOff)) - $imgoff = ''; + if ($datas['img_off']) + $imgoff = ''; + if ($datas['img_on']) + $imgoff = ''; - if (is_file($registry->get('GV_RootPath') . 'config/' . $sb_pathOn)) - $imgon = ''; - - $labeloff = $sb['labelOff']; - $labelon = $sb['labelOn']; + $labeloff = $datas['labeloff']; + $labelon = $datas['labelon']; $sbFilters .= '
' . '' . '' . '' . '' . '' . '
' . - '' . - '' . + '' . + '' . '' . - '' . - '' . + '' . + '' . '
' . '
'; } - } - } - if ($sxe->description) - { - foreach ($sxe->description->children() as $f => $field) - { - if ($field['type'] == 'date' && $field['searchclient'] == '1') - { - $dateFilters .= '
' . - '' . - '' . - '
' . - $f . '
' . _('phraseanet::time:: de') . - '' . - _('phraseanet::time:: a') . - '
' . - '' . - ' ' . - '' . - '
' . - '
'; - } - elseif ($field['type'] != 'date') - { - $fieldsFilters .= ''; - } - } - if ($dateFilters != '' || $sbFilters != '' || $fieldsFilters != '') - { - echo '
' . _('client::recherche: filter sur') . '
' . - '
 
'; - } - } - } -?> -
-
get_sxml_structure(); + if ($sxe) + { + $sbFilters = ''; + $dateFilters = $fieldsFilters = ''; + if ($sxe->statbits->bit) + { + foreach ($sxe->statbits->bit as $sb) + { + if ($sb['searchclient'] && $sb['searchclient'] == '1') + { + + + $sb_pathOff = '/status/' . $databox->get_host() . "-" . $databox->get_port() . "-" . $databox->get_dbname() . '-' . 'stat_' . $sb['n'] . '_0.gif'; + $sb_pathOn = '/status/' . $databox->get_host() . "-" . $databox->get_port() . "-" . $databox->get_dbname() . '-' . 'stat_' . $sb['n'] . '_1.gif'; + + $imgoff = ''; + $imgon = ''; + + if (is_file($registry->get('GV_RootPath') . 'config/' . $sb_pathOff)) + $imgoff = ''; + + + if (is_file($registry->get('GV_RootPath') . 'config/' . $sb_pathOn)) + $imgon = ''; + + $labeloff = $sb['labelOff']; + $labelon = $sb['labelOn']; + + $sbFilters .= '
' . + '' . + '' . + '' . + '' . + '' . + '
' . + '' . + '' . + '' . + '' . + '' . + '
' . + '
'; + } + } + } + if ($sxe->description) + { + foreach ($sxe->description->children() as $f => $field) + { + if ($field['type'] == 'date' && $field['searchclient'] == '1') + { + $dateFilters .= '
' . + '' . + '' . + '
' . + $f . '
' . _('phraseanet::time:: de') . + '' . + _('phraseanet::time:: a') . + '
' . + '' . + ' ' . + '' . + '
' . + '
'; + } + elseif ($field['type'] != 'date') + { + $fieldsFilters .= ''; + } + } + if ($dateFilters != '' || $sbFilters != '' || $fieldsFilters != '') + { + echo '
' . _('client::recherche: filter sur') . '
' . + '
 
'; + } + } + } + ?> +
+ +
get_collections() as $coll) { $s = "checked"; echo '
'; } -?>
get('GV_view_bas_and_coll')) echo '
'; } -?> -
-
-
- -get('GV_thesaurus')) - { -?> - -
-
-
- -
+ ?>
- -
-
+
+ + get('GV_thesaurus')) + { + ?> + +
+
+
+ +
- - - - -
-
- - -
- -get('GV_client_render_topics') == 'popups') - echo queries::dropdown_topics(); - elseif ($registry->get('GV_client_render_topics') == 'tree') - echo queries::tree_topics(); -?> - -
-
- - -
-
-
-
- -
-
- -
-
-
-
-
- -
-
-
-
-
-
-
-
-
-
-
-
-
-
    -
  • -
  • -
  • -
-
-
-
-
-
-
-
-
-
-
-
+ +
+
-
-
-
+ + + +
-
-
- -
- -
+ - -