[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r625 - in trunk/rapport_avance: . include include/templa
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r625 - in trunk/rapport_avance: . include include/template |
Date: |
Wed, 18 Dec 2013 02:24:42 +0100 (CET) |
Author: danydb
Date: 2013-12-18 02:24:41 +0100 (Wed, 18 Dec 2013)
New Revision: 625
Added:
trunk/rapport_avance/ajax_include_follow.php
trunk/rapport_avance/ajax_include_follow_save.php
trunk/rapport_avance/include/template/include_follow.php
Modified:
trunk/rapport_avance/ajax.php
trunk/rapport_avance/include/class_rapav_listing_compute.php
trunk/rapport_avance/include/class_rapav_listing_compute_fiche.php
trunk/rapport_avance/rapav_javascript.js
Log:
Task #935 ajout dans le suivi
Task #935 - Listing : inclure dans Suivi
Modified: trunk/rapport_avance/ajax.php
===================================================================
--- trunk/rapport_avance/ajax.php 2013-12-17 23:34:47 UTC (rev 624)
+++ trunk/rapport_avance/ajax.php 2013-12-18 01:24:41 UTC (rev 625)
@@ -9,7 +9,8 @@
'rapav_search_code,save_param_detail,rapav_declaration_display,'.
'listing_modify,listing_remove_modele,listing_display_definition,'.
'listing_param_add,save_param_listing,listing_detail_remove,'.
-
'listing_search_code,rapav_listing_display,parameter_send_mail,send_mail');
+
'listing_search_code,rapav_listing_display,parameter_send_mail,send_mail,'
+ . 'include_follow,include_follow_save');
if ( in_array($act,$a_action ) == true )
{
include 'ajax_'.$act.'.php';
Added: trunk/rapport_avance/ajax_include_follow.php
===================================================================
--- trunk/rapport_avance/ajax_include_follow.php
(rev 0)
+++ trunk/rapport_avance/ajax_include_follow.php 2013-12-18 01:24:41 UTC
(rev 625)
@@ -0,0 +1,53 @@
+<?php
+global $g_user;
+
+
+ob_start();
+
+$titre = new IText('ag_title');
+
+// Profile in charged of the action
+$ag_dest = new ISelect();
+$ag_dest->name = "ag_dest";
+// select profile
+$aAg_dest = $cn->make_array("select p_id as value, " .
+ "p_name as label " .
+ " from profile "
+ . "where p_id in (select p_granted from "
+ . " user_sec_action_profile where ua_right='W' and p_id=" .
$g_user->get_profile() . ") order by 2");
+$ag_dest->value = $aAg_dest;
+
+// -- Date
+$date = new IDate();
+$date->name = "ag_timestamp";
+$date->value = date('d.m.Y');
+
+// -- remind date
+$remind_date = new IDate();
+$remind_date->name = "ag_remind_date";
+$remind_date->value = "";
+
+// -- document
+$category = new ISelect('dt_id');
+$category->value = $cn->make_array("select dt_id,dt_value from document_type
order by dt_value");
+$category->readOnly = false;
+
+//-- description
+$desc = new ITextArea();
+$desc->style = ' class="itextarea" style="width:80%;margin-left:0px"';
+$desc->name = "ag_comment";
+
+require_once 'include/template/include_follow.php';
+
+$response = ob_get_clean();
+ob_end_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;
+?>
\ No newline at end of file
Added: trunk/rapport_avance/ajax_include_follow_save.php
===================================================================
--- trunk/rapport_avance/ajax_include_follow_save.php
(rev 0)
+++ trunk/rapport_avance/ajax_include_follow_save.php 2013-12-18 01:24:41 UTC
(rev 625)
@@ -0,0 +1,20 @@
+<?php
+
+require_once 'include/class_rapav_listing_compute.php';
+
+ob_start();
+$compute = new RAPAV_Listing_Compute();
+$compute->load($_GET['lc_id']);
+$compute->include_follow($_GET);
+$response = ob_get_clean();
+ob_end_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;
+?>
\ No newline at end of file
Modified: trunk/rapport_avance/include/class_rapav_listing_compute.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing_compute.php
2013-12-17 23:34:47 UTC (rev 624)
+++ trunk/rapport_avance/include/class_rapav_listing_compute.php
2013-12-18 01:24:41 UTC (rev 625)
@@ -15,6 +15,7 @@
require_once 'class_rapav_listing_formula.php';
require_once 'class_rapport_avance_sql.php';
require_once 'class_rapav_listing_compute_fiche.php';
+
class RAPAV_Listing_Compute
{
@@ -300,7 +301,6 @@
$ofiche=new RAPAV_Listing_Compute_Fiche();
$r_fiche=$ofiche->seek (" where lc_id = $1",array($this->data->lc_id));
$nb_fiche=Database::num_row($r_fiche);
- if (isNumber($p_id)==0) {$p_id=0;}
$a_result=array();
/* For each card */
for ($i = 0;$i < $nb_fiche;$i++)
@@ -414,11 +414,11 @@
function propose_include_follow()
{
- echo '<form method="GET" action="extension.raw.php" class="noprint"
style="display:inline">';
+ echo '<form method="GET" action="ajax.php"
onsubmit="js_include_follow();return false;" id="include_follow_frm"
class="noprint" style="display:inline">';
echo
HtmlInput::array_to_hidden(array('ac','gDossier','plugin_code','sa'),
$_REQUEST);
echo HtmlInput::hidden('lc_id',$this->data->lc_id);
- echo HtmlInput::hidden('act','include_follow_up');
- echo HtmlInput::submit("include_follow_up", "Inclure dans les
actions","","smallbutton");
+ echo HtmlInput::hidden('act','include_follow');
+ echo HtmlInput::submit("include_follow", "Inclure dans les
actions","","smallbutton");
echo '</form>';
return 0;
}
@@ -433,5 +433,22 @@
echo '</form>';
return 0;
}
-
+ function include_follow($p_array)
+ {
+ global $cn;
+ $ofiche=new RAPAV_Listing_Compute_Fiche();
+ $r_fiche=$ofiche->seek (" where lc_id = $1",array($this->data->lc_id));
+ $nb_fiche=Database::num_row($r_fiche);
+ if (isNumber($p_id)==0) {$p_id=0;}
+ $a_result=array();
+ /* For each card */
+ $cn->start();
+ for ($i = 0;$i < $nb_fiche;$i++)
+ {
+ $fiche=$ofiche->next($r_fiche,$i);
+ $a_result[]=$fiche->include_follow($p_array);
+ }
+ $cn->commit();
+ return $a_result;
+ }
}
Modified: trunk/rapport_avance/include/class_rapav_listing_compute_fiche.php
===================================================================
--- trunk/rapport_avance/include/class_rapav_listing_compute_fiche.php
2013-12-17 23:34:47 UTC (rev 624)
+++ trunk/rapport_avance/include/class_rapav_listing_compute_fiche.php
2013-12-18 01:24:41 UTC (rev 625)
@@ -6,6 +6,8 @@
* and open the template in the editor.
*/
require_once 'class_sendmail.php';
+require_once 'class_follow_up.php';
+
/**
* Description of class_rapav_listing_compute_fiche
*
@@ -562,5 +564,20 @@
return $result;
}
}
+ function include_follow($p_array)
+ {
+ global $cn;
+ $action=new Follow_Up($cn);
+ if (isDate($p_array['ag_date'])==null)
$p_array['ag_date']=date('d.m.Y');
+ if ( trim($p_array['ag_title']) == "")$p_array['ag_title']="Ajouté
depuis plugin";
+
+ $action->fromArray($p_array);
+
+ $action->f_id_dest=$this->f_id;
+ $fiche = new Fiche($cn, $this->f_id);
+ $action->qcode_dest=$fiche->strAttribut(ATTR_DEF_QUICKCODE);
+ $_POST['nb_item']=0;
+ $action->save();
+ }
}
Added: trunk/rapport_avance/include/template/include_follow.php
===================================================================
--- trunk/rapport_avance/include/template/include_follow.php
(rev 0)
+++ trunk/rapport_avance/include/template/include_follow.php 2013-12-18
01:24:41 UTC (rev 625)
@@ -0,0 +1,68 @@
+<?php echo HtmlInput::title_box("Suivi", "include_follow_result"); ?>
+<form method="GET" onsubmit="js_include_follow_save();
+ return false;" id="include_follow_save_frm">
+ <table>
+ <tr>
+ <td>
+ <label>Date</label>
+ </td>
+ <td>
+ <?php echo $date->input(); ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label>Date rappel</label>
+ </td>
+ <td>
+ <?php echo $remind_date->input(); ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label>
+ Profil
+ </label>
+ </td>
+ <td>
+
+ <?php echo $ag_dest->input(); ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label>Titre </label>
+ </td>
+ <td>
+ <?php echo $titre->input(); ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label>
+ Catégorie
+ </label>
+ </td>
+ <td>
+ <?php echo $category->input(); ?>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <label>Commentaire</label>
+ </td>
+ <td>
+ <?php echo $desc->input(); ?>
+ </td>
+ </tr>
+ </table>
+ <p>
+ <?php
+ echo HtmlInput::array_to_hidden(array('gDossier', 'plugin_code', 'ac',
'lc_id'), $_REQUEST);
+ echo HtmlInput::hidden('act', 'include_follow_save');
+ echo HtmlInput::submit('include_follow_save_sbm', "Sauver", "",
"smallbutton");
+ echo HtmlInput::button_close('include_follow_result');
+ ?>
+ </p>
+
+</form>
Modified: trunk/rapport_avance/rapav_javascript.js
===================================================================
--- trunk/rapport_avance/rapav_javascript.js 2013-12-17 23:34:47 UTC (rev
624)
+++ trunk/rapport_avance/rapav_javascript.js 2013-12-18 01:24:41 UTC (rev
625)
@@ -949,6 +949,9 @@
}
function send_email()
{
+ if (trim($('p_from').value)=="") { alert('champs obligatoire manquant');
$('p_from').style.border="solid 2px red";return false;}
+ if (trim($('p_subject').value)=="") { alert('champs obligatoire
manquant'); $('p_subject').style.border="solid 2px red";return false;}
+ if (trim($('p_attach').value)=="") { alert('champs obligatoire manquant');
$('p_attach').style.border="solid 2px red";return false;}
try {
var qs = $('parameter_send_email_input_frm').serialize(false);
waiting_box();
@@ -984,4 +987,81 @@
return false;
}
+}
+function js_include_follow()
+{
+ try {
+ console.log('include_follow');
+ var qs = $('include_follow_frm').serialize(false);
+ waiting_box();
+ var action = new Ajax.Request(
+ "ajax.php",
+ {
+ method: 'get',
+ parameters: qs,
+ onFailure: ajax_misc_failure,
+ onSuccess: function(req) {
+ var answer = req.responseXML;
+ var a = answer.getElementsByTagName('ctl');
+ var html = answer.getElementsByTagName('code');
+ if (a.length == 0) {
+ var rec = req.responseText;
+ throw 'cannot find ctl element';
+ }
+ remove_waiting_box();
+ var code_html = getNodeText(html[0]);
+ code_html = unescape_xml(code_html);
+ console.log(code_html);
+ var position = fixed_position(451, 217) + ';width:50%';
+ add_div({'id': 'include_follow_result', 'cssclass':
'inner_box', 'drag': 1, 'style': position});
+ $('include_follow_result').innerHTML = code_html;
+ remove_waiting_box();
+ }
+ }
+ );
+ return false;
+ } catch (e)
+ {
+ alert(e.message);
+ return false;
+
+ }
+}
+function js_include_follow_save()
+{
+ try {
+ var qs = $('include_follow_save_frm').serialize(false);
+ waiting_box();
+ var action = new Ajax.Request(
+ "ajax.php",
+ {
+ method: 'get',
+ parameters: qs,
+ onFailure: ajax_misc_failure,
+ onSuccess: function(req) {
+ var answer = req.responseXML;
+ var a = answer.getElementsByTagName('ctl');
+ var html = answer.getElementsByTagName('code');
+ if (a.length == 0) {
+ var rec = req.responseText;
+ throw 'cannot find ctl element';
+ }
+ remove_waiting_box();
+ var code_html = getNodeText(html[0]);
+ code_html = unescape_xml(code_html);
+ console.log(code_html);
+ var position = fixed_position(451, 217) + ';width:50%';
+ add_div({'id': 'include_follow_save_result',
'cssclass': 'inner_box', 'drag': 1, 'style': position});
+ $('include_follow_save_result').innerHTML = code_html;
+ remove_waiting_box();
+ }
+ }
+ );
+ return false;
+ } catch (e)
+ {
+ alert(e.message);
+ return false;
+
+ }
}
\ No newline at end of file
---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpcompta-dev] r625 - in trunk/rapport_avance: . include include/template,
phpcompta-dev <=