2010-12-02 23:34:41 +00:00
|
|
|
<?php
|
|
|
|
|
/**
|
|
|
|
|
* weekend.php
|
2012-10-17 17:21:35 -04:00
|
|
|
*
|
2010-12-02 23:34:41 +00:00
|
|
|
* ProcessMaker Open Source Edition
|
|
|
|
|
* Copyright (C) 2004 - 2008 Colosa Inc.23
|
2012-10-17 17:21:35 -04:00
|
|
|
*
|
2010-12-02 23:34:41 +00:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2012-10-17 17:21:35 -04:00
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
2010-12-02 23:34:41 +00:00
|
|
|
* GNU Affero General Public License for more details.
|
2012-10-17 17:21:35 -04:00
|
|
|
*
|
2010-12-02 23:34:41 +00:00
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
2012-10-17 17:21:35 -04:00
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*
|
|
|
|
|
* For more information, contact Colosa Inc, 2566 Le Jeune Rd.,
|
2010-12-02 23:34:41 +00:00
|
|
|
* Coral Gables, FL, 33134, USA, or email info@colosa.com.
|
|
|
|
|
*/
|
2012-10-17 17:21:35 -04:00
|
|
|
if (($RBAC_Response = $RBAC->userCanAccess( "PM_SETUP" )) != 1)
|
|
|
|
|
return $RBAC_Response;
|
|
|
|
|
$G_ENABLE_BLANK_SKIN = true;
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-10-17 17:21:35 -04:00
|
|
|
$ARR_WEEKDAYS[0] = array ('SUNDAY','MONDAY','TUESDAY','WEDNESDAY','THURSDAY','FRIDAY','SATURDAY'
|
|
|
|
|
);
|
|
|
|
|
$ARR_WEEKDAYS['es'] = array ("Domingo?","Lunes?","Martes?","Miércoles?","Jueves?","Viernes?","Sábado?"
|
|
|
|
|
);
|
|
|
|
|
$ARR_WEEKDAYS['en'] = array ("Sunday?","Monday?","Tuesday?","Wednesday?","Thursday?","Friday?","Saturday?"
|
|
|
|
|
);
|
|
|
|
|
$ARR_WEEKDAYS['fa'] = array ('یکشنبه','دوشنبه','سه شنبه','چهارشنبه','پنجشنبه ','جمعه','آدینه'
|
|
|
|
|
);
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-10-17 17:21:35 -04:00
|
|
|
$dbc = new DBConnection();
|
|
|
|
|
$ses = new DBSession( $dbc );
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-10-17 17:21:35 -04:00
|
|
|
$holidays = $ses->execute( "SELECT LEX_VALUE FROM LEXICO WHERE LEX_TOPIC ='NOWORKINGDAY' " );
|
2010-12-02 23:34:41 +00:00
|
|
|
|
2012-10-17 17:21:35 -04:00
|
|
|
$config = array ();
|
|
|
|
|
for ($id = 0; $id < 7; $id ++) {
|
|
|
|
|
$res = $ses->execute( " SELECT * FROM LEXICO WHERE LEX_KEY = '" . $ARR_WEEKDAYS[0][$id] . "' AND LEX_TOPIC ='HOLIDAY' " );
|
|
|
|
|
$res = $res->read();
|
|
|
|
|
$config[$ARR_WEEKDAYS[0][$id]] = $res['LEX_VALUE'];
|
2010-12-02 23:34:41 +00:00
|
|
|
}
|
2012-10-17 17:21:35 -04:00
|
|
|
$G_PUBLISH = new Publisher();
|
|
|
|
|
$G_PUBLISH->AddContent( 'xmlform', 'xmlform', 'setup/weekend', '', $config, '' );
|
2010-12-02 23:34:41 +00:00
|
|
|
G::RenderPage( 'publish' );
|
|
|
|
|
?>
|
|
|
|
|
<script language="JavaScript">
|
|
|
|
|
function var_dump(obj)
|
|
|
|
|
{
|
|
|
|
|
msg='';
|
|
|
|
|
if (typeof(obj)=='object')
|
|
|
|
|
for(a in obj)
|
|
|
|
|
{
|
|
|
|
|
msg+=a;//+':'+obj[a];
|
|
|
|
|
msg+="\t";
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
msg=obj;
|
|
|
|
|
alert(msg);
|
|
|
|
|
}
|
|
|
|
|
function on_submit(myForm)
|
|
|
|
|
{
|
|
|
|
|
days='';values='';
|
|
|
|
|
for(cbi in myForm.elements)
|
|
|
|
|
if (cbi.substr(0,4)=='form')
|
|
|
|
|
{
|
|
|
|
|
cb=myForm.elements[cbi];
|
|
|
|
|
days+=','+cb.id;
|
|
|
|
|
values+=','+cb.checked;
|
|
|
|
|
}
|
2012-07-23 10:33:03 -04:00
|
|
|
ajax_function('<?php echo G::encryptLink('weekendAjax.php');?>','setDays','days='+days+'&values='+values);
|
2010-12-02 23:34:41 +00:00
|
|
|
document.location.reload(true);
|
|
|
|
|
}
|
|
|
|
|
function ajax_function(ajax_server, funcion, parameters)
|
|
|
|
|
{
|
2012-10-17 17:21:35 -04:00
|
|
|
objetus = get_xmlhttp();
|
2010-12-02 23:34:41 +00:00
|
|
|
var response;
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
if (parameters) parameters = '&' + encodeURI(parameters);
|
2012-10-17 17:21:35 -04:00
|
|
|
objetus.open("GET", ajax_server + "?function=" + funcion + parameters, false);
|
2010-12-02 23:34:41 +00:00
|
|
|
}catch(ss)
|
2012-10-17 17:21:35 -04:00
|
|
|
{
|
2010-12-02 23:34:41 +00:00
|
|
|
alert("error"+ss.message);
|
|
|
|
|
}
|
|
|
|
|
objetus.send(null);
|
|
|
|
|
return objetus.responseText;
|
|
|
|
|
}
|
|
|
|
|
</script>
|