Merge with master

This commit is contained in:
Romain Neutron
2012-01-16 20:19:20 +01:00
26 changed files with 661 additions and 25 deletions

View File

@@ -176,7 +176,72 @@ class Users implements ControllerProviderInterface
} }
); );
$controllers->post('/apply_template/', function(Application $app) $controllers->post('/search/export/', function() use ($app)
{
$request = $app['request'];
$users = new module_admin_route_users($request);
$template = 'admin/users.html';
$twig = new supertwig();
$twig->addFilter(array('floor' => 'floor'));
$twig->addFilter(array('getDate' => 'phraseadate::getDate'));
$results = $users->export($request);
$userTable = array(
array(
'ID',
'Login',
'Last Name',
'First Name',
'E-Mail',
'Created',
'Updated',
'Address',
'City',
'Zip',
'Country',
'Phone',
'Fax',
'Job',
'Company',
'Position'
)
);
foreach ($results as $user)
{
/* @var $user \User_Adapter */
$userTable[] = array(
$user->get_id(),
$user->get_login(),
$user->get_lastname(),
$user->get_firstname(),
$user->get_email(),
$user->get_creation_date()->format(DATE_ATOM),
$user->get_modification_date()->format(DATE_ATOM),
$user->get_address(),
$user->get_city(),
$user->get_zipcode(),
$user->get_country(),
$user->get_tel(),
$user->get_fax(),
$user->get_job(),
$user->get_company(),
$user->get_position()
);
}
$CSVDatas = format::arr_to_csv($userTable);
$response = new Response($CSVDatas, 200, array('Content-Type' => 'text/plain'));
$response->headers->set('Content-Disposition', 'attachment; filename=export.txt');
return $response;
}
);
$controllers->post('/apply_template/', function() use ($app)
{ {
$users = UserHelper\Manage($app['Core'], $app['request']); $users = UserHelper\Manage($app['Core'], $app['request']);

View File

@@ -39,7 +39,52 @@ class Manage extends \Alchemy\Phrasea\Helper\Helper
*/ */
protected $usr_id; protected $usr_id;
public function search() public function __construct(Symfony\Component\HttpFoundation\Request $request)
{
$this->request = $request;
return $this;
}
public function export(Symfony\Component\HttpFoundation\Request $request)
{
$appbox = appbox::get_instance();
$session = $appbox->get_session();
$offset_start = (int) $request->get('offset_start');
$offset_start = $offset_start < 0 ? 0 : $offset_start;
$this->query_parms = array(
'inactives' => $request->get('inactives')
, 'like_field' => $request->get('like_field')
, 'like_value' => $request->get('like_value')
, 'sbas_id' => $request->get('sbas_id')
, 'base_id' => $request->get('base_id')
, 'srt' => $request->get("srt", User_Query::SORT_CREATIONDATE)
, 'ord' => $request->get("ord", User_Query::ORD_DESC)
, 'offset_start' => 0
);
$user = User_Adapter::getInstance($session->get_usr_id(), $appbox);
$query = new User_Query($appbox);
if (is_array($this->query_parms['base_id']))
$query->on_base_ids($this->query_parms['base_id']);
elseif (is_array($this->query_parms['sbas_id']))
$query->on_sbas_ids($this->query_parms['sbas_id']);
$this->results = $query->sort_by($this->query_parms["srt"], $this->query_parms["ord"])
->like($this->query_parms['like_field'], $this->query_parms['like_value'])
->get_inactives($this->query_parms['inactives'])
->include_templates(false)
->on_bases_where_i_am($user->ACL(), array('canadmin'))
->execute();
return $this->results->get_results();
}
public function search(Symfony\Component\HttpFoundation\Request $request)
{ {
$appbox = \appbox::get_instance(); $appbox = \appbox::get_instance();

View File

@@ -218,9 +218,11 @@ class appbox extends base
{ {
$sqlupd = "UPDATE bas SET ord = :ordre WHERE base_id = :base_id"; $sqlupd = "UPDATE bas SET ord = :ordre WHERE base_id = :base_id";
$stmt = $this->get_connection()->prepare($sqlupd); $stmt = $this->get_connection()->prepare($sqlupd);
$stmt->execute(array(':ordre' => $ord, ':base_id' => $collection->get_base_id())); $stmt->execute(array(':ordre' => $ordre, ':base_id' => $collection->get_base_id()));
$stmt->closeCursor(); $stmt->closeCursor();
$collection->get_databox()->delete_data_from_cache(\databox::CACHE_COLLECTIONS);
return $this; return $this;
} }

View File

@@ -609,7 +609,7 @@ class collection implements cache_cacheableInterface
$registry = registry::get_instance(); $registry = registry::get_instance();
if (is_file($registry->get('GV_RootPath') . 'config/wm/' . $base_id)) if (is_file($registry->get('GV_RootPath') . 'config/wm/' . $base_id))
self::$_watermarks['base_id'] = '<img src="/watermark/' . $base_id . '" />'; self::$_watermarks['base_id'] = '<img src="/custom/wm/' . $base_id . '" />';
} }
return isset(self::$_watermarks['base_id']) ? self::$_watermarks['base_id'] : ''; return isset(self::$_watermarks['base_id']) ? self::$_watermarks['base_id'] : '';
@@ -622,7 +622,7 @@ class collection implements cache_cacheableInterface
$registry = registry::get_instance(); $registry = registry::get_instance();
if (is_file($registry->get('GV_RootPath') . 'config/presentation/' . $base_id)) if (is_file($registry->get('GV_RootPath') . 'config/presentation/' . $base_id))
self::$_presentations['base_id'] = '<img src="/presentation/' . $base_id . '" />'; self::$_presentations['base_id'] = '<img src="/custom/presentation/' . $base_id . '" />';
} }
return isset(self::$_presentations['base_id']) ? self::$_presentations['base_id'] : ''; return isset(self::$_presentations['base_id']) ? self::$_presentations['base_id'] : '';
@@ -635,7 +635,7 @@ class collection implements cache_cacheableInterface
$registry = registry::get_instance(); $registry = registry::get_instance();
if (is_file($registry->get('GV_RootPath') . 'config/stamp/' . $base_id)) if (is_file($registry->get('GV_RootPath') . 'config/stamp/' . $base_id))
self::$_stamps['base_id'] = '<img src="/stamp/' . $base_id . '" />'; self::$_stamps['base_id'] = '<img src="/custom/stamp/' . $base_id . '" />';
} }
return isset(self::$_stamps['base_id']) ? self::$_stamps['base_id'] : ''; return isset(self::$_stamps['base_id']) ? self::$_stamps['base_id'] : '';

View File

@@ -843,8 +843,8 @@ function sqlFromFilters($usr, $filters)
foreach ($filters->countries as $country) foreach ($filters->countries as $country)
{ {
$c['country' . $n] = $country; $c['country' . $n] = $country;
}
$n++; $n++;
}
$precise.=" AND usr.pays IN (:" . implode(", :", array_keys($c)) . ")"; $precise.=" AND usr.pays IN (:" . implode(", :", array_keys($c)) . ")";
$params = array_merge($params, $c); $params = array_merge($params, $c);
} }
@@ -855,8 +855,8 @@ function sqlFromFilters($usr, $filters)
foreach ($filters->activite as $activite) foreach ($filters->activite as $activite)
{ {
$c['activite' . $n] = $activite; $c['activite' . $n] = $activite;
}
$n++; $n++;
}
$precise.=" AND usr.activite IN (:" . implode(", :", array_keys($c)) . ")"; $precise.=" AND usr.activite IN (:" . implode(", :", array_keys($c)) . ")";
$params = array_merge($params, $c); $params = array_merge($params, $c);
} }
@@ -867,8 +867,8 @@ function sqlFromFilters($usr, $filters)
foreach ($filters->fonction as $fonction) foreach ($filters->fonction as $fonction)
{ {
$c['fonction' . $n] = $fonction; $c['fonction' . $n] = $fonction;
}
$n++; $n++;
}
$precise.=" AND usr.fonction IN (:" . implode(", :", array_keys($c)) . ")"; $precise.=" AND usr.fonction IN (:" . implode(", :", array_keys($c)) . ")";
$params = array_merge($params, $c); $params = array_merge($params, $c);
} }
@@ -879,8 +879,8 @@ function sqlFromFilters($usr, $filters)
foreach ($filters->societe as $societe) foreach ($filters->societe as $societe)
{ {
$c['societe' . $n] = $societe; $c['societe' . $n] = $societe;
}
$n++; $n++;
}
$precise.=" AND usr.societe IN (:" . implode(", :", array_keys($c)) . ")"; $precise.=" AND usr.societe IN (:" . implode(", :", array_keys($c)) . ")";
$params = array_merge($params, $c); $params = array_merge($params, $c);
} }
@@ -891,8 +891,8 @@ function sqlFromFilters($usr, $filters)
foreach ($filters->template as $template) foreach ($filters->template as $template)
{ {
$c['template' . $n] = $template; $c['template' . $n] = $template;
}
$n++; $n++;
}
$precise.=" AND usr.lastModel IN (:" . implode(", :", array_keys($c)) . ")"; $precise.=" AND usr.lastModel IN (:" . implode(", :", array_keys($c)) . ")";
$params = array_merge($params, $c); $params = array_merge($params, $c);
} }

View File

@@ -206,6 +206,7 @@ class mail
$body = eregi_replace("[\]", '', $body); $body = eregi_replace("[\]", '', $body);
$body .= "<br/>\n"._('Si le lien n\'est pas cliquable, copiez-collez le dans votre navigateur.')."<br/>\n";
$body .= "<br/><br/><br/><br/>\n\n\n\n"; $body .= "<br/><br/><br/><br/>\n\n\n\n";
$body .= '<div style="font-style:italic;">' . _('phraseanet::signature automatique des notifications par mail, infos a l\'url suivante') . "</div>\n"; $body .= '<div style="font-style:italic;">' . _('phraseanet::signature automatique des notifications par mail, infos a l\'url suivante') . "</div>\n";
$body .= '<div><a href="' . $registry->get('GV_ServerName') . '">' . $registry->get('GV_ServerName') . "</a></div>\n"; $body .= '<div><a href="' . $registry->get('GV_ServerName') . '">' . $registry->get('GV_ServerName') . "</a></div>\n";

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CountryCode extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CountryCode';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CountryCode';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CreatorAddress extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CreatorAddress';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CreatorAddress';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CreatorCity extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CreatorCity';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CreatorCity';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CreatorCountry extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CreatorCountry';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CreatorCountry';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CreatorPostalCode extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CreatorPostalCode';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CreatorPostalCode';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CreatorRegion extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CreatorRegion';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CreatorRegion';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CreatorWorkEmail extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CreatorWorkEmail';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CreatorWorkEmail';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CreatorWorkTelephone extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CreatorWorkTelephone';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CreatorWorkTelephone';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_CreatorWorkURL extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:CreatorWorkURL';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'CreatorWorkURL';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_IntellectualGenre extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:IntellectualGenre';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'IntellectualGenre';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_Location extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:Location';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'Location';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,28 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_Scene extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:Scene';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'Scene';
const MAX_LENGTH = 0;
const MULTI = true;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,28 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPiptcCore_SubjectCode extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-iptcCore:SubjectCode';
const NAME_SPACE = 'XMP-iptcCore';
const TAGNAME = 'SubjectCode';
const MAX_LENGTH = 0;
const MULTI = false;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPxmpRights_Certificate extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-xmpRights:Certificate';
const NAME_SPACE = 'XMP-xmpRights';
const TAGNAME = 'Certificate';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPxmpRights_Marked extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-xmpRights:Marked';
const NAME_SPACE = 'XMP-xmpRights';
const TAGNAME = 'Marked';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_BOOLEAN;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPxmpRights_Owner extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-xmpRights:Owner';
const NAME_SPACE = 'XMP-xmpRights';
const TAGNAME = 'Owner';
const MULTI = true;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPxmpRights_UsageTerms extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-xmpRights:UsageTerms';
const NAME_SPACE = 'XMP-xmpRights';
const TAGNAME = 'UsageTerms';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2010 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
/**
*
* @package
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
* @link www.phraseanet.com
*/
class metadata_description_XMPxmpRights_WebStatement extends metadata_Abstract implements metadata_Interface
{
const SOURCE = '/rdf:RDF/rdf:Description/XMP-xmpRights:WebStatement';
const NAME_SPACE = 'XMP-xmpRights';
const TAGNAME = 'WebStatement';
const MAX_LENGTH = 0;
const TYPE = self::TYPE_STRING;
}

View File

@@ -186,6 +186,23 @@
</tbody> </tbody>
</table> </table>
<form id="export_form" method="post" target="exportwindow" action="/admin/users/search/export/">
<input name="srt" value="{{parm['srt']}}" type="hidden" />
<input name="ord" value="{{parm.ord}}" type="hidden" />
<input name="act" value="{{parm.act}}" type="hidden" />
{% for sbas_id in parm.sbas_id %}
<input name="sbas_id[]" value="{{sbas_id}}" type="hidden" />
{% endfor %}
{% for base_id in parm.base_id %}
<input name="base_id[]" value="{{base_id}}" type="hidden" />
{% endfor %}
<input name="usr_ids" value="{{parm.usr_ids}}" type="hidden" />
<input name="like_value" value="{{parm.like_value}}" type="hidden" />
<input name="like_field" value="{{parm.like_field}}" type="hidden" />
<input name="inactives" value="{{parm.inactives}}" type="hidden" />
</form>
<form id="users_page_form" method="post" target="_self" action="/admin/users/search/"> <form id="users_page_form" method="post" target="_self" action="/admin/users/search/">
{{users.get_total}} resultats {{users.get_total}} resultats
@@ -268,7 +285,21 @@
$('#users_page_form select[name="per_page"]').bind('change', function(){ $('#users_page_form select[name="per_page"]').bind('change', function(){
$(this).closest('form').submit(); $(this).closest('form').submit();
}); });
}); });
function importlist()
{
var myObj = new Object();
myObj.myOpener = self;
window.showModalDialog ('/admin/import0.php?rand='+Math.random(),myObj, 'dialogWidth:550px;dialogHeight:330px;center:yes;help:no;status:no;scrollbars:no' );
}
function exportlist()
{
$('#export_form').submit();
}
</script> </script>
</div> </div>
{% endblock %} {% endblock %}

View File

@@ -1796,14 +1796,15 @@ function preset_delete(preset_id, li)
"act":"DELETE", "act":"DELETE",
"presetid":preset_id "presetid":preset_id
}; };
$.getJSON( $.ajax({
"/xmlhttp/editing_presets.j.php", type: 'POST',
p, url: "/xmlhttp/editing_presets.j.php",
function(data, textStatus) data: p,
{ dataType: 'json',
success: function(data, textStatus){
li.remove(); li.remove();
} }
); });
} }
function preset_load(preset_id) function preset_load(preset_id)
@@ -1812,6 +1813,7 @@ function preset_load(preset_id)
"act":"LOAD", "act":"LOAD",
"presetid":preset_id "presetid":preset_id
}; };
$.getJSON( $.getJSON(
"/xmlhttp/editing_presets.j.php", "/xmlhttp/editing_presets.j.php",
p, p,
@@ -2224,15 +2226,17 @@ function startThisEditing(sbas_id,what,regbasprid,ssel)
x += "</fields>"; x += "</fields>";
p["f"] = x; p["f"] = x;
$.getJSON( $.ajax({
"/xmlhttp/editing_presets.j.php", type: 'POST',
p, url: "/xmlhttp/editing_presets.j.php",
function(data, textStatus) data: p,
dataType: 'json',
success: function(data, textStatus)
{ {
preset_paint(data); preset_paint(data);
$("#Edit_copyPreset_dlg").dialog("close"); $("#Edit_copyPreset_dlg").dialog("close");
} }
); });
}; };
buttons[language.annuler] = function() buttons[language.annuler] = function()
{ {