[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpcompta-dev] r5438 - in phpcompta/trunk: html include include/templat
From: |
phpcompta-dev |
Subject: |
[Phpcompta-dev] r5438 - in phpcompta/trunk: html include include/template |
Date: |
Fri, 27 Sep 2013 21:51:08 +0200 (CEST) |
Author: danydb
Date: 2013-09-27 21:51:08 +0200 (Fri, 27 Sep 2013)
New Revision: 5438
Modified:
phpcompta/trunk/html/style-print.css
phpcompta/trunk/html/style.css
phpcompta/trunk/include/action.common.inc.php
phpcompta/trunk/include/class_follow_up.php
phpcompta/trunk/include/template/action_other_action.php
Log:
Page break when printing multiple
Add clean tag, remove document, ...
Modified: phpcompta/trunk/html/style-print.css
===================================================================
--- phpcompta/trunk/html/style-print.css 2013-09-27 19:50:19 UTC (rev
5437)
+++ phpcompta/trunk/html/style-print.css 2013-09-27 19:51:08 UTC (rev
5438)
@@ -289,4 +289,5 @@
}
#info_div {
display:none;
-}
\ No newline at end of file
+}
+p#breakhere {page-break-before: always}
\ No newline at end of file
Modified: phpcompta/trunk/html/style.css
===================================================================
--- phpcompta/trunk/html/style.css 2013-09-27 19:50:19 UTC (rev 5437)
+++ phpcompta/trunk/html/style.css 2013-09-27 19:51:08 UTC (rev 5438)
@@ -1348,4 +1348,4 @@
color:error;
font-weight: bold;
text-align: center;
-}
\ No newline at end of file
+}
Modified: phpcompta/trunk/include/action.common.inc.php
===================================================================
--- phpcompta/trunk/include/action.common.inc.php 2013-09-27 19:50:19 UTC
(rev 5437)
+++ phpcompta/trunk/include/action.common.inc.php 2013-09-27 19:51:08 UTC
(rev 5438)
@@ -41,23 +41,37 @@
/*-----------------------------------------------------------------------------*/
/* For other action
/*-----------------------------------------------------------------------------*/
-if ( isset ($_GET['other_action_bt'])) {
- var_dump($_GET);
+if ( isset ($_POST['other_action_bt'])) {
/**
* The action id are in the array mag_id
* the tag to remove are vin the array remtag
* the tag to add are in the array addtag
* the state in ag_state
*/
- if ( isset ($_GET['ag_id'])) {
- switch ($_GET['othact']) {
+ if ( isset ($_POST['mag_id'])) {
+ switch ($_POST['othact']) {
case 'IMP':
//Impression
+ Follow_Up::action_print($cn,$_POST);
+ exit(0);
+ break;
case 'ST':
// Etat
+ Follow_Up::action_set_state($cn, $_POST);
+ break;
case 'ETIREM':
//tag
+ Follow_Up::action_tag_remove($cn, $_POST);
+ break;
case 'ETIADD':
+ Follow_Up::action_tag_add($cn, $_POST);
+ break;
+ case 'ETICLEAR':
+ Follow_Up::action_tag_clear($cn,$_POST);
+ break;
+ case 'DOCREM':
+ Follow_Up::action_remove($cn, $_POST);
+ break;
}
}
}
Modified: phpcompta/trunk/include/class_follow_up.php
===================================================================
--- phpcompta/trunk/include/class_follow_up.php 2013-09-27 19:50:19 UTC (rev
5437)
+++ phpcompta/trunk/include/class_follow_up.php 2013-09-27 19:51:08 UTC (rev
5438)
@@ -87,10 +87,10 @@
* \param p_cn database connection
*/
- function __construct($p_cn)
+ function __construct($p_cn,$p_id=0)
{
$this->db = $p_cn;
- $this->ag_id=0;
+ $this->ag_id=$p_id;
$this->f_id = 0;
}
static function sql_security_filter($cn,$p_mode)
@@ -117,7 +117,7 @@
* \note If ag_id is not equal to zero then it is an update otherwise
* it is a new document
*
- * \param $p_view if set to true the form will be in readonly mode
(value: true or false)
+ * \param $p_view form will be in readonly mode (value: READ, UPD or
NEW )
* \param $p_gen true we show the tag for generating a doc (value :
true or false) and adding files
* \param $p_base is the ac parameter
* \param $retour is the html code for the return button
@@ -508,7 +508,7 @@
$a_tag=$this->tag_get();
/* get template */
ob_start();
- require_once 'template/detail-action.php';
+ require 'template/detail-action.php';
$content = ob_get_contents();
ob_end_clean();
$r.=$content;
@@ -1209,7 +1209,7 @@
*/
$query = Follow_Up::create_query($cn);
- echo '<form method="get" id="list_ag_frm"
style="display:inline">';
+ echo '<form method="POST" id="list_ag_frm"
style="display:inline">';
echo
HtmlInput::request_to_hidden(array("gDossier","ac","sb","sc","f_id"));
require_once 'template/action_other_action.php';
echo $act->myList($p_base, "", $query);
@@ -1502,4 +1502,87 @@
echo HtmlInput::button('tag_bt', 'Ajout tag',$js, 'smallbutton');
}
+ static function action_tag_remove($cn,$p_array)
+ {
+ global $g_user;
+ $mag_id=$p_array['mag_id'];
+ $remtag=$p_array['remtag'];
+ for ($i=0;$i< count($mag_id);$i++)
+ {
+ if ($g_user->can_write_action($mag_id[$i]) == false) continue;
+ for ($e=0;$e<count($remtag);$e++)
+ {
+ $a=new Follow_Up($cn,$mag_id[$i]);
+ $a->tag_remove($remtag[$e]);
+ }
+ }
+
+ }
+ static function action_tag_add($cn,$p_array)
+ {
+ global $g_user;
+ $mag_id=$p_array['mag_id'];
+ $addtag=$p_array['addtag'];
+ for ($i=0;$i< count($mag_id);$i++)
+ {
+ if ($g_user->can_write_action($mag_id[$i]) == false) continue;
+ for ($e=0;$e<count($addtag);$e++)
+ {
+ $a=new Follow_Up($cn,$mag_id[$i]);
+ $a->tag_add($addtag[$e]);
+ }
+ }
+ }
+ static function action_tag_clear($cn,$p_array)
+ {
+ global $g_user;
+ $mag_id=$p_array['mag_id'];
+ for ($i=0;$i< count($mag_id);$i++)
+ {
+ if ($g_user->can_write_action($mag_id[$i]) == false) continue;
+ $a=new Follow_Up($cn,$mag_id[$i]);
+ $a->tag_clear();
+ }
+ }
+ static function action_print($cn,$p_array)
+ {
+ global $g_user;
+ $mag_id=$p_array['mag_id'];
+ for ($i=0;$i< count($mag_id);$i++)
+ {
+ if ($g_user->can_read_action($mag_id[$i]) == false) continue;
+ $a=new Follow_Up($cn,$mag_id[$i]);
+ $a->get();
+ echo $a->Display("READ", false, "");
+ echo '<P id="breakhere"> - - </p>';
+ }
+ }
+ function tag_clear() {
+ $this->db->exec_sql('delete from action_tags where
ag_id=$1',array($this->ag_id));
+ }
+ static function action_set_state($cn,$p_array)
+ {
+
+ global $g_user;
+ $mag_id=$p_array['mag_id'];
+ $state=$p_array['ag_state'];
+ for ($i=0;$i< count($mag_id);$i++)
+ {
+ if ($g_user->can_write_action($mag_id[$i]) == false) continue;
+ $cn->exec_sql('update action_gestion set ag_state=$1 where
ag_id=$2',
+ array($state,$mag_id[$i]));
+ }
+ }
+ static function action_remove($cn,$p_array)
+ {
+ global $g_user;
+
+ $mag_id=$p_array['mag_id'];
+ for ($i=0;$i< count($mag_id);$i++)
+ {
+ if ($g_user->can_write_action($mag_id[$i]) == false) continue;
+ $cn->exec_sql('delete from action_gestion where ag_id=$1',
+ array($mag_id[$i]));
+ }
+ }
}
Modified: phpcompta/trunk/include/template/action_other_action.php
===================================================================
--- phpcompta/trunk/include/template/action_other_action.php 2013-09-27
19:50:19 UTC (rev 5437)
+++ phpcompta/trunk/include/template/action_other_action.php 2013-09-27
19:51:08 UTC (rev 5438)
@@ -43,9 +43,24 @@
<span id="remtag_choose_td">
</span>
</li>
+ <li>
+ <?php $radio->value="ETICLEAR";echo $radio->input(); ?>
+ Enlever toutes les étiquettes des documents choisis
+ </li>
+ <li>
+ <?php $radio->value="DOCREM";echo $radio->input(); ?>
+ Effacer les documents choisis
+ </li>
</ul>
<?php
echo HtmlInput::submit("other_action_bt", "Valider");
?>
</div>
+<script>
+ new Draggable('other_div',{starteffect:function(){
+ new
Effect.Highlight(obj.id,{scroll:window,queue:'end'});
+ }
+ }
+ );
+</script>
---
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] r5438 - in phpcompta/trunk: html include include/template,
phpcompta-dev <=