コード例 #1
0
 /**
  *@brief transform into xml for ajax answer
  */
 public function toXML()
 {
     $id = '<tl_id>' . $this->tl_id . '</tl_id>';
     $title = '<tl_title>' . escape_xml($this->tl_title) . '</tl_title>';
     $desc = '<tl_desc>' . escape_xml($this->tl_desc) . '</tl_desc>';
     $date = '<tl_date>' . $this->tl_date . '</tl_date>';
     $ret = '<data>' . $id . $title . $desc . $date . '</data>';
     return $ret;
 }
コード例 #2
0
$opd_description->style = ' class="itextarea" style="width:30em;height:4em;vertical-align:top"';
$opd_description->value = $op->od_description;
echo '<p>';
echo _("Description (max 50 car.)");
echo $opd_description->input();
echo '</p>';
echo dossier::hidden() . HtmlInput::hidden('od_id', $_GET['id']);
echo "<hr>";
//////////////////////////////////////////////////////////////////////////////
// Detail operation
//////////////////////////////////////////////////////////////////////////////
echo $op->display();
echo HtmlInput::submit('save', _('Sauve'));
echo HtmlInput::button('close', _('Annuler'), 'onclick="removeDiv(\'mod_predf_op\')"');
echo '</form>';
$html1 = ob_get_contents();
ob_end_clean();
$html = escape_xml($html1);
if (headers_sent()) {
    echo $html1;
} else {
    header('Content-type: text/xml; charset=UTF-8');
}
echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<ctl>mod_predf_op</ctl>
<code>{$html}</code>
</data>
EOF
;
コード例 #3
0
ファイル: ac_common.php プロジェクト: Kloadut/noalyss_ynh
function ajax_xml_error($p_code, $p_string)
{
    $html = escape_xml($p_string);
    header('Content-type: text/xml; charset=UTF-8');
    echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<code>{$p_code}</code>
<value>{$html}</value>
</data>
EOF;
}
コード例 #4
0
    /*
     * save via javascript and don't reload page
     */
} else {
    ?>
    <form id="tag_detail_frm" method="POST" onsubmit="return save_tag();">
<?php 
}
?>
        
    <?php 
echo dossier::hidden();
echo HtmlInput::hidden('t_id', $_GET['tag']);
echo HtmlInput::hidden('ac', $_GET['ac']);
$data = $tag->data;
require_once 'template/tag_detail.php';
echo HtmlInput::submit("save_tag_sb", "Valider");
?>
</form>
<?php 
$response = ob_get_clean();
$html = escape_xml($response);
header('Content-type: text/xml; charset=UTF-8');
echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<ctl></ctl>
<code>{$html}</code>
</data>
EOF;
exit;
コード例 #5
0
        $dom->appendChild($tl_id);
        echo $dom->saveXML();
        return;
    }
    ob_start();
    echo HtmlInput::title_box(_('Liste utilisateurs'), "shared_" . $id);
    $todo->display_user();
    echo '<p style="text-align:center">';
    echo HtmlInput::submit('close' . $id, 'Ferme', " onclick=\"\$('shared_{$id}').remove();\"");
    echo '</p>';
    $result = ob_get_clean();
    //
    // output the XML
    header('Content-type: text/xml; charset=UTF-8');
    $dom = new DOMDocument('1.0', 'UTF-8');
    $tl_id = $dom->createElement('content', escape_xml($result));
    $dom->appendChild($tl_id);
    echo $dom->saveXML();
    return;
}
////////////////////////////////////////////////////////////////////////////////
// Share the note with someone or remove it
////////////////////////////////////////////////////////////////////////////////
if ($ac == "set_share") {
    $id = HtmlInput::default_value_get("todo_id", 0);
    $p_login = HtmlInput::default_value_get("login", "");
    // If note_id is not correct then give an error
    if ($id == 0 || isNumber($id) == 0 || trim($p_login) == "") {
        header('Content-type: text/xml; charset=UTF-8');
        $dom = new DOMDocument('1.0', 'UTF-8');
        $tl_id = $dom->createElement('content', _("Erreur : paramètre invalide"));
コード例 #6
0
require_once NOALYSS_INCLUDE . '/class_dossier.php';
require_once NOALYSS_INCLUDE . '/class_pre_operation.php';
// Check if the needed field does exist
extract($_GET);
foreach (array('l', 't', 'd', 'gDossier') as $a) {
    if (!isset(${$a})) {
        echo "error {$a} is not set ";
        exit;
    }
}
$cn = new Database(dossier::id());
$op = new Pre_operation_detail($cn);
$op->set('ledger', $l);
$op->set('ledger_type', $t);
$op->set('direct', $d);
$url = http_build_query(array('action' => 'use_opd', 'p_jrn_predef' => $l, 'ac' => $_GET['ac'], 'gDossier' => dossier::id()));
$html = "";
$html .= HtmlInput::title_box(_("Modèle d'opérations"), 'modele_op_div', 'hide');
$html .= $op->show_button('do.php?' . $url);
$html = escape_xml($html);
header('Content-type: text/xml; charset=UTF-8');
echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<code></code>
<value>{$html}</value>
</data>
EOF;
?>

コード例 #7
0
    if (Database::num_row($R) != 0) {
        $message = _("Ne peut pas effacer le poste: d'autres postes en dépendent");
        $ctl = 'nok';
    } else {
        /* Vérifier que le poste n'est pas utilisé qq part dans les journaux */
        $Res = $cn->exec_sql("select * from jrnx where j_poste=\$1", array($p_valu));
        if (Database::num_row($Res) != 0) {
            $message = _("Ne peut pas effacer le poste: il est utilisé dans les journaux");
            $ctl = 'nok';
        } else {
            $Del = $cn->exec_sql("delete from tmp_pcmn where pcm_val=\$1", array($p_valu));
        }
        // if Database::num_row
    }
    // if Database::num_row
}
//$action == del
$message = escape_xml($message);
if (!headers_sent()) {
    header('Content-type: text/xml; charset=UTF-8');
} else {
    echo "HTML" . unescape_xml($html);
}
echo <<<EOF
<?xml version="1.0" encoding="UTF-8"?>
<data>
<ctl>{$ctl}</ctl>
<code>{$message}</code>
</data>
EOF
;
コード例 #8
0
ファイル: ajax_admin.php プロジェクト: Kloadut/noalyss_ynh
                    $wDesc = new ITextArea();
                    $wDesc->heigh = 5;
                    echo '<br>Description :<br>';
                    echo $wDesc->input('desc', $desc);
                    echo HtmlInput::hidden('m', $dossier);
                    echo HtmlInput::hidden('action', 'modele_mgt');
                    echo '<br>';
                    echo HtmlInput::submit('upd', 'Modifie');
                    echo '</form>';
                    $content = ob_get_clean();
                    $status = 'OK';
                }
            }
        }
    }
    //----------------------------------------------------------------
    // Answer in XML
    header('Content-type: text/xml; charset=UTF-8');
    $dom = new DOMDocument('1.0', 'UTF-8');
    $xml = escape_xml($content);
    $xml_content = $dom->createElement('content', $xml);
    $xml_status = $dom->createElement('status', $status);
    $root = $dom->createElement("root");
    $root->appendChild($xml_content);
    $root->appendChild($xml_status);
    $dom->appendChild($root);
    echo $dom->saveXML();
    exit;
}
?>
        
コード例 #9
0
ファイル: rss.php プロジェクト: cjbayliss/alloc
$query = prepare("SELECT audit.taskID, field, dateChanged, value, taskName, taskStatus, task.personID, audit.projectID\n                    FROM audit\n               LEFT JOIN task AS task ON audit.taskID = task.taskID\n                   WHERE field IN ('taskStatus', 'personID')\n                ORDER BY dateChanged DESC\n                   LIMIT %d", $max_events);
$db->query($query);
while ($row = $db->next_record()) {
    $key = $row['dateChanged'] . gen_key(1);
    $el = array("date" => $row['dateChanged']);
    //overwrite the new data (taskStatus, personID) with the correct (historical) data
    if ($trace[$row['taskID']]) {
        $row = array_merge($row, $trace[$row['taskID']]);
    }
    if (!$row['personID']) {
        $name = "Unassigned";
    } else {
        $name = $people[$row['personID']]['username'];
    }
    if ($row['field'] != "taskStatus" || array_search($row['taskStatus'], $status_types) !== FALSE) {
        $taskName = escape_xml($row['taskName']);
        $project = null;
        if ($show_project) {
            $project = new project();
            $project->set_id($row['projectID']);
            $project->select();
        }
        if ($summary) {
            if ($show_project) {
                $projectName = $project->get_value('projectShortName');
            }
            $el['desc'] = sprintf('%s: %d %s "%s" %s', $name, $row['taskID'], $projectName, $taskName, $row['taskStatus']);
        } else {
            if ($show_project) {
                $projectName = "(" . $project->get_value("projectName") . ")";
            }