コード例 #1
2
 /**
  * Préparation de dompdf pour la conversion
  * 
  * @param string $format      format de la page
  * @param string $orientation orientation de la page
  * 
  * @return void
  */
 function prepare($format, $orientation)
 {
     CAppUI::requireModuleFile("dPcompteRendu", "dompdf_config");
     CAppUI::requireLibraryFile("dompdf/dompdf_config.inc");
     $this->dompdf = new dompdf();
     $this->dompdf->set_base_path(realpath(dirname(__FILE__) . "/../../../../"));
     $this->dompdf->set_paper($format, $orientation);
     if (CAppUI::conf("dPcompteRendu CCompteRendu dompdf_host")) {
         $this->dompdf->set_protocol(isset($_SERVER["HTTPS"]) ? "https://" : "http://");
         $this->dompdf->set_host($_SERVER["SERVER_NAME"]);
     }
 }
コード例 #2
0
 function getPassword($pwd = null, $iv_field = "iv")
 {
     if (is_null($pwd)) {
         $pwd = $this->password;
         if (!$this->password) {
             return "";
         }
     }
     try {
         $master_key_filepath = CAppUI::conf("master_key_filepath");
         $master_key_filepath = rtrim($master_key_filepath, "/");
         if (CExchangeSource::checkMasterKeyFile($master_key_filepath)) {
             CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/AES");
             CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/Random");
             $cipher = new Crypt_AES(CRYPT_AES_MODE_CTR);
             $cipher->setKeyLength(256);
             $keyAB = file($master_key_filepath . "/.mediboard.key");
             if (count($keyAB) == 2) {
                 $cipher->setKey($keyAB[0] . $keyAB[1]);
                 $ivToUse = $this->{$iv_field};
                 if (!$ivToUse) {
                     $clear = $pwd;
                     $this->store();
                     return $clear;
                 }
                 $cipher->setIV($ivToUse);
                 $decrypted = rtrim(base64_decode($pwd), "");
                 $decrypted = $cipher->decrypt($decrypted);
                 if ($decrypted) {
                     return $decrypted;
                 }
             }
         }
     } catch (Exception $e) {
         return $pwd;
     }
     return $pwd;
 }
コード例 #3
0
<?php

/**
 * $Id$
 *  
 * @category 
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CAppUI::requireLibraryFile("PDFMerger/PDFMerger");
/**
 * Classe de gestion de fusion de pdf héritant de PDFMerger
 */
class CMbPDFMerger extends PDFMerger
{
    static $temp_files = array();
    function addPDF($file_path)
    {
        // Suppression de l'autoprint et travail sur copie temporaire (afin de ne pas altérer le document original)
        @mkdir("./tmp/pdfmerge");
        $temp_file = tempnam("./tmp/pdfmerge", "pdfmerge");
        $temp_files[] = $temp_file;
        $content = file_get_contents($file_path);
        $content = CWkHtmlToPDFConverter::removeAutoPrint($content);
        file_put_contents($temp_file, $content);
        self::$temp_files[] = $temp_file;
        parent::addPDF($temp_file);
    }
コード例 #4
0
<?php

/* $Id$ */
/**
 *  @package Mediboard
 *  @subpackage webservices
 *  @version $Revision$
 *  @author SARL OpenXtrem
 */
CAppUI::requireLibraryFile("NuSOAP/nusoap", false);
if (!class_exists("nusoap_client", false)) {
    return;
}
/**
 * The CNuSOAPClient class
 */
class CNuSOAPClient extends nusoap_client
{
    public $wsdl_url;
    public $type_echange_soap;
    public $soap_client_error = false;
    public $flatten;
    public $loggable;
    public $encoding;
    /**
     * The constructor
     * 
     * @param string  $rooturl     The URL of the wsdl file
     * @param string  $type        The type of exchange
     * @param array   $options     An array of options
     * @param boolean $loggable    True if you want to log all the exchanges with the web service
コード例 #5
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Labo
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CAppUI::requireLibraryFile("jpgraph/src/mbjpgraph");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_line");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_plotband");
class CResultatsLaboGraph extends Graph
{
    public $maxValues = 10;
    public $resultats;
    function CResultatsLaboGraph($patient, $examen, $resultats)
    {
        $resultats = array_reverse($resultats, true);
        if ($examen->type != "num") {
            JpGraphError::raise("Le type d'examen doit être numérique pour être affiché");
        }
        // Prepare values
        // Value plot
        $ydata = array();
        $xlabels = array();
        $min = $examen->min;
        $max = $examen->max;
        foreach ($resultats as $resultat) {
コード例 #6
0
<?php

/**
 * $Id$
 *
 * @category Files
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
$user = CUser::get();
CAppUI::requireLibraryFile("phpThumb/phpthumb.class");
include_once "lib/phpThumb/phpThumb.config.php";
//require_once("./lib/phpThumb/phpthumb.class.php");
//trigger_error("Source is $file->_file");
ob_clean();
// Direct acces needs Administrator rights
$file_path = CValue::get("file_path");
if ($file_path) {
    $file_size = filesize($file_path);
    $file_type = "text/xml";
    $file_name = basename($file_path);
    if ($user->user_type == 1) {
        // BEGIN extra headers to resolve IE caching bug (JRP 9 Feb 2003)
        // [http://bugs.php.net/bug.php?id=16173]
        header("Pragma: ");
        header("Cache-Control: ");
        header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
        header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
コード例 #7
0
ファイル: CCronJob.class.php プロジェクト: fbone/mediboard4
 /**
  * Load the library
  *
  * @return void
  */
 static function loadLibrary()
 {
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/FieldInterface");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/AbstractField");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/CronExpression");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/DayOfMonthField");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/DayOfWeekField");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/FieldFactory");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/SecondsField");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/HoursField");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/MinutesField");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/MonthField");
     CAppUI::requireLibraryFile("cron-expression-1.0.3/src/Cron/YearField");
 }
コード例 #8
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage dPstats
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CAppUI::requireLibraryFile("jpgraph/src/mbjpgraph");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_bar");
$debut = CValue::get("debut", CMbDT::date("-1 YEAR"));
$fin = CValue::get("fin", CMbDT::date());
$prat_id = CValue::get("prat_id", 0);
$service_id = CValue::get("service_id", 0);
$pratSel = new CMediusers();
$pratSel->load($prat_id);
$service = new CSalle();
$service->load($service_id);
$datax = array();
for ($i = $debut; $i <= $fin; $i = CMbDT::date("+1 MONTH", $i)) {
    $datax[] = CMbDT::transform("+0 DAY", $i, "%m/%Y");
}
$sql = "SELECT * FROM service WHERE";
if ($service_id) {
    $sql .= "\nAND id = '{$service_id}'";
}
$ds = CSQLDataSource::get("std");
$services = $ds->loadlist($sql);
コード例 #9
0
ファイル: CMbString.class.php プロジェクト: fbone/mediboard4
 /**
  * Apply syntax highlighting
  *
  * @param String $language       Code language
  * @param String $code           Code to format
  * @param bool   $enable_classes Enable the CSS class
  * @param string $style          CSS class to apply
  *
  * @return mixed
  */
 static function highlightCode($language, $code, $enable_classes = true, $style = "max-height: 100%; white-space:pre-wrap;")
 {
     if (!class_exists("GeSHi", false)) {
         CAppUI::requireLibraryFile("geshi/geshi");
     }
     $geshi = new GeSHi($code, $language);
     $geshi->enable_line_numbers(GESHI_NORMAL_LINE_NUMBERS);
     $geshi->set_overall_style($style);
     $geshi->set_overall_class("geshi");
     if ($enable_classes) {
         $geshi->enable_classes();
     }
     return $geshi->parse_code();
 }
コード例 #10
0
 /**
  * Truncate a string, with a full string titled span if actually truncated
  * Example:  {$value|spancate}
  *
  * @param string $string      The string to truncate
  * @param int    $length      The maximum string length
  * @param string $etc         The ellipsis
  * @param bool   $break_words Break words
  * @param bool   $middle      Put the ellipsis at the middle of the string instead of at the end
  *
  * @return string
  */
 function spancate($string, $length = 80, $etc = '...', $break_words = true, $middle = false)
 {
     CAppUI::requireLibraryFile("smarty/libs/plugins/modifier.truncate");
     $string = html_entity_decode($string);
     $truncated = smarty_modifier_truncate($string, $length, $etc, $break_words, $middle);
     $truncated = CMbString::nl2bull($truncated);
     $string = CMbString::htmlEntities($string);
     return strlen($string) > $length ? "<span title=\"{$string}\">{$truncated}</span>" : $truncated;
 }
コード例 #11
0
 /**
  * Convert tif files to pdf
  *
  * @param array[] $tif_files array of tif files
  *
  * @return bool
  */
 static function convertTifPagesToPDF($tif_files)
 {
     if (!class_exists("FPDF")) {
         CAppUI::requireLibraryFile("PDFMerger/fpdf/fpdf");
     }
     $pngs = array();
     foreach ($tif_files as $tif) {
         $pngs[] = self::convertTifToPng($tif);
         // "C:\\ImageMagick6.6.0-Q16\\"
     }
     $pdf = new FPDF();
     foreach ($pngs as $png) {
         $pdf->AddPage();
         $pdf->Image($png, 5, 5, 200);
         // millimeters
     }
     $out = $pdf->Output("", 'S');
     foreach ($pngs as $png) {
         unlink($png);
     }
     return $out;
 }
コード例 #12
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
global $can, $m;
CAppUI::requireLibraryFile("jpgraph/src/mbjpgraph");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_line");
class AudiogrammeTympano extends Graph
{
    /** @var self */
    public static $gauche = null;
    /** @var self */
    public static $droite = null;
    function setTitle($title)
    {
        $this->title->Set($title);
    }
    function AudiogrammeTympano()
    {
        $pressions = CExamAudio::$pressions;
        // Setup the graph.
        $this->Graph(280, 160, "auto");
        $this->SetScale("textlin", 0, 15);
        $this->SetMarginColor("lightblue");
コード例 #13
0
ファイル: CSFTP.class.php プロジェクト: fbone/mediboard4
<?php

/**
 * $Id$
 *  
 * @category Classes
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version  $Revision$
 * @link     http://www.mediboard.org
 */
CAppUI::requireLibraryFile("phpseclib/phpseclib/Net/SFTP");
$root = CAppUI::conf("root_dir");
/**
 * PHPseclib test the inclusion of file with a relatif path
 */
set_include_path(get_include_path() . PATH_SEPARATOR . $root . '/lib/phpseclib/phpseclib');
/**
 * Class SFTP
 */
class CSFTP
{
    public $hostname;
    public $port;
    public $timeout;
    public $username;
    public $userpass;
    public $loggable;
    public $fileextension;
    public $fileextension_end;
コード例 #14
0
<?php

/**
 * $Id$
 *
 * @package    Mediboard
 * @subpackage System
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision$
 */
CAppUI::requireLibraryFile("phpmailer/class.phpmailer");
CAppUI::requireLibraryFile("phpmailer/class.smtp");
class CSourceSMTP extends CExchangeSource
{
    // DB Table key
    public $source_smtp_id;
    // DB Fields
    public $port;
    public $email;
    public $auth;
    public $ssl;
    public $timeout;
    public $debug;
    public $_mail;
    public $_to;
    function getSpec()
    {
        $spec = parent::getSpec();
        $spec->table = 'source_smtp';
        $spec->key = 'source_smtp_id';
コード例 #15
0
/**
 * $Id: inc_graph_audio_vocal.php 20068 2013-07-26 13:21:27Z rhum1 $
 *
 * @package    Mediboard
 * @subpackage Cabinet
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
 * @version    $Revision: 20068 $
 */
global $can, $m;
CAppUI::requireModuleFile("dPcabinet", "jpgraph_bezier");
CAppUI::requireLibraryFile("jpgraph/src/mbjpgraph");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_line");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_scatter");
CAppUI::requireLibraryFile("jpgraph/src/jpgraph_regstat");
function xPseudoAxisFormatCb($value)
{
    $value -= 50;
    $value *= 100;
    // Prevents rounding errors intrinsic to float values...
    $value = round($value);
    $value *= 10;
    return sprintf("%d", $value);
}
class AudiogrammeVocal extends Graph
{
    /** @var self */
    public static $graph = null;
    function AudiogrammeVocal()
    {
コード例 #16
0
 * $Id$
 *  
 * @package  Mediboard
 * @author   SARL OpenXtrem <*****@*****.**>
 * @license  GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @link     http://www.mediboard.org */
CAppUI::requireLibraryFile("phpseclib/phpseclib/Math/BigInteger");
CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/Hash");
CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/Random");
CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/RSA");
CAppUI::requireLibraryFile("phpseclib/phpseclib/File/ASN1");
CAppUI::requireLibraryFile("phpseclib/phpseclib/File/X509");
CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/AES");
CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/DES");
CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/Rijndael");
CAppUI::requireLibraryFile("phpseclib/phpseclib/Crypt/TripleDES");
/**
 * Generic security class, uses pure-PHP library phpseclib
 */
class CMbSecurity
{
    // Ciphers
    const AES = 1;
    const DES = 2;
    const TDES = 3;
    const RIJNDAEL = 4;
    // Encryption modes
    const CTR = CRYPT_AES_MODE_CTR;
    const ECB = CRYPT_AES_MODE_ECB;
    const CBC = CRYPT_AES_MODE_CBC;
    const CFB = CRYPT_AES_MODE_CFB;
コード例 #17
0
 /**
  * Get the data URI of a barcode
  *
  * @param string $code    Code
  * @param array  $options Options
  *
  * @return null|string
  */
 function getBarcodeDataUri($code, $options)
 {
     if (!$code) {
         return null;
     }
     $size = "{$options['width']}x{$options['width']}";
     if (isset(self::$barcodeCache[$code][$size])) {
         return self::$barcodeCache[$code][$size];
     }
     CAppUI::requireLibraryFile("tcpdf/barcode/barcode");
     CAppUI::requireLibraryFile("tcpdf/barcode/c128bobject");
     CAppUI::requireLibraryFile("tcpdf/barcode/cmb128bobject");
     $bc_options = (BCD_DEFAULT_STYLE | BCS_DRAW_TEXT) & ~BCS_BORDER;
     $barcode = new CMb128BObject($options["width"] * 2, $options["height"] * 2, $bc_options, $code);
     $barcode->SetFont(7);
     $barcode->DrawObject(2);
     ob_start();
     $barcode->FlushObject();
     $image = ob_get_contents();
     ob_end_clean();
     $barcode->DestroyObject();
     $image = "data:image/png;base64," . urlencode(base64_encode($image));
     return self::$barcodeCache[$code][$size] = $image;
 }
コード例 #18
0
<?php

/**
 * $Id$
 * 
 * @package    Mediboard
 * @subpackage classes
 * @author     SARL OpenXtrem <*****@*****.**>
 * @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html 
 * @version    $Revision$
 */
CAppUI::requireLibraryFile("iCalcreator/iCalcreator.class");
if (!class_exists("vcalendar", false)) {
    return;
}
class CMbCalendar extends vcalendar
{
    function __construct($name, $description = "")
    {
        parent::__construct();
        //Ajout de quelques proporiétés
        $this->setProperty("method", "PUBLISH");
        $this->setProperty("x-wr-calname", $name);
        if ($description) {
            $this->setProperty("X-WR-CALDESC", $description);
        }
        $this->setProperty("X-WR-TIMEZONE", CAppUI::conf("timezone"));
    }
    //fonction permettant de créer un evènement de calendrier de façon simplifiée
    function addEvent($location, $summary, $description, $comment, $guid, $start, $end)
    {
コード例 #19
0
ファイル: CMbPdf.class.php プロジェクト: fbone/mediboard4
 * @version    $Revision: 26699 $
 */
define("K_TCPDF_EXTERNAL_CONFIG", "config_externe");
define("K_PATH_MAIN", CAppUI::conf('root_dir') . "/lib/tcpdf/");
define("K_PATH_URL", "");
define("FPDF_FONTPATH", K_PATH_MAIN . "fonts/");
define("K_PATH_CACHE", K_PATH_MAIN . "cache/");
define("K_PATH_URL_CACHE", K_PATH_URL . "cache/");
define("K_PATH_IMAGES", K_PATH_MAIN . "../../images/pictures/");
define("K_BLANK_IMAGE", K_PATH_IMAGES . "_blank.png");
define("HEAD_MAGNIFICATION", 1.1);
define("K_CELL_HEIGHT_RATIO", 1.25);
define("K_TITLE_MAGNIFICATION", 1.3);
define("K_SMALL_RATIO", 2 / 3);
CAppUI::requireLibraryFile("tcpdf/config/lang/eng");
CAppUI::requireLibraryFile("tcpdf/tcpdf");
function asc_shift($str, $offset = 0)
{
    $new = '';
    for ($i = 0; $i < strlen($str); $i++) {
        $new .= chr(ord($str[$i]) + $offset);
    }
    return $new;
}
// Classe de gestion des pdf heritant de TCPDF
function is_utf8($str)
{
    return utf8_encode(utf8_decode($str)) == $str;
}
function to_utf8($str)
{
コード例 #20
0
<?php

/**
* $Id$
*
* @package    Mediboard
* @subpackage search
* @author     SARL OpenXtrem <*****@*****.**>
* @license    GNU General Public License, see http://www.gnu.org/licenses/gpl.html
* @version    $Revision$
*/
CAppUI::requireLibraryFile("Elastica/autoloader", false);
use Elastica\Aggregation;
/**
 * Class CSearchAggregation
 * Manage Elastica Library in order to aggregate documents
 */
class CSearchAggregation
{
    /** @var  Elastica\Aggregation\AbstractAggregation */
    public $_aggregation;
    /**
     * Constructor
     *
     * @param string  $type  The type of the aggregation
     * @param string  $name  The name of the aggregation
     * @param string  $field The index field where you want to make the aggregation.
     * @param integer $size  The size of the aggregation
     *
     * @return Elastica\Aggregation\Terms |mixed
     */