├── README.md ├── administrator ├── access.xml ├── config.xml ├── controller.php ├── controllers │ ├── comment.php │ ├── comments.php │ ├── index.html │ ├── issue.php │ ├── issues.php │ ├── key.php │ └── keys.php ├── helpers │ ├── improvemycity.php │ └── index.html ├── improvemycity.php ├── index.html ├── language │ ├── el-GR.com_improvemycity.ini │ ├── el-GR.com_improvemycity.sys.ini │ ├── en-GB.com_improvemycity.ini │ ├── en-GB.com_improvemycity.sys.ini │ └── index.html ├── models │ ├── comment.php │ ├── comments.php │ ├── fields │ │ ├── custom_field.php │ │ └── index.html │ ├── forms │ │ ├── comment.xml │ │ ├── index.html │ │ ├── issue.xml │ │ └── key.xml │ ├── index.html │ ├── issue.php │ ├── issues.php │ ├── key.php │ ├── keys.php │ ├── reports.php │ └── rules │ │ ├── index.html │ │ ├── title.php │ │ └── votes.php ├── sql │ ├── index.html │ ├── install.mysql.utf8.sql │ ├── uninstall.mysql.utf8.sql │ └── updates │ │ └── mysql │ │ ├── 2.2.sql │ │ ├── 2.4.1.sql │ │ ├── 2.5.0.sql │ │ ├── 2.5.1.sql │ │ ├── 2.5.3.sql │ │ └── 2.5.4.sql ├── tables │ ├── comment.php │ ├── index.html │ ├── issue.php │ └── key.php └── views │ ├── comment │ ├── index.html │ ├── tmpl │ │ ├── edit.php │ │ ├── edit_metadata.php │ │ ├── edit_options.php │ │ └── index.html │ └── view.html.php │ ├── comments │ ├── index.html │ ├── tmpl │ │ ├── default.php │ │ └── index.html │ └── view.html.php │ ├── index.html │ ├── issue │ ├── index.html │ ├── tmpl │ │ ├── edit.php │ │ ├── edit_metadata.php │ │ ├── edit_options.php │ │ └── index.html │ └── view.html.php │ ├── issues │ ├── index.html │ ├── tmpl │ │ ├── default.php │ │ └── index.html │ └── view.html.php │ ├── key │ ├── index.html │ ├── tmpl │ │ ├── edit.php │ │ ├── edit_metadata.php │ │ ├── edit_options.php │ │ └── index.html │ └── view.html.php │ ├── keys │ ├── index.html │ ├── tmpl │ │ ├── default.php │ │ └── index.html │ └── view.html.php │ └── reports │ ├── index.html │ ├── tmpl │ ├── default.php │ ├── default_print.php │ └── index.html │ ├── view.html.php │ └── view.print.php ├── improvemycity.xml ├── license.txt ├── media ├── images │ ├── improvemycity-128x128.png │ ├── improvemycity-16x16.png │ ├── improvemycity-24x24.png │ ├── improvemycity-256x256.png │ ├── improvemycity-32x32.png │ ├── improvemycity-48x48.png │ └── index.html └── index.html ├── script.php └── site ├── bootstrap ├── css │ ├── bootstrap-responsive.css │ ├── bootstrap-responsive.min.css │ ├── bootstrap.css │ ├── bootstrap.min.css │ └── index.html ├── img │ ├── glyphicons-halflings-white.png │ ├── glyphicons-halflings.png │ └── index.html ├── index.html └── js │ ├── bootstrap.js │ ├── bootstrap.min.js │ └── index.html ├── controller.php ├── controllers ├── index.html ├── issue.php ├── issues.php └── mobile.json.php ├── css ├── ie.css ├── improvemycity.css ├── improvemycity_nohtml5.css ├── improvemycity_print.css ├── index.html ├── mega-menu.css └── print.css ├── helpers ├── category.php ├── improvemycity.php ├── index.html └── simpleimage.php ├── images ├── ajax-loader.gif ├── arrow_ack.png ├── arrow_closed.png ├── arrow_gray.png ├── arrow_open.png ├── arrows.psd ├── close.png ├── drop.gif ├── drop.png ├── error.png ├── index.html ├── lock.png ├── lock2.png ├── marker-ack.png ├── marker-closed.png ├── marker-open.png ├── marker.png ├── mod_box_header.png ├── no-avatar.png ├── shadow.png ├── steps_ok.png └── tipbox.gif ├── improvemycity.php ├── index.html ├── js ├── improvemycity.js ├── index.html ├── infobox.js ├── infobox_packed.js ├── jquery-1.7.1.min.js └── jquery-ui-1.8.18.custom.min.js ├── language ├── el-GR.com_improvemycity.ini ├── en-GB.com_improvemycity.ini └── index.html ├── models ├── addissue.php ├── discussions.php ├── fields │ ├── custom_field.php │ └── index.html ├── forms │ ├── index.html │ ├── issue.js │ └── issue.xml ├── index.html ├── issue.php ├── issues.php ├── keys.php ├── rules │ ├── catid.php │ ├── index.html │ └── title.php ├── smartlogin.php └── users.php ├── router.php └── views ├── addissue ├── index.html ├── submitbutton.js ├── tmpl │ ├── default.php │ ├── default_nohtml5.php │ └── index.html └── view.html.php ├── index.html ├── issue ├── index.html ├── tmpl │ ├── default.php │ ├── default_nohtml5.php │ ├── default_print.php │ └── index.html ├── view.html.php ├── view.print.php └── view.raw.php ├── issues ├── index.html ├── tmpl │ ├── default.php │ ├── default.xml │ ├── default_nohtml5.php │ ├── default_print.php │ └── index.html ├── view.html.php ├── view.print.php └── view.raw.php └── smartlogin ├── index.html ├── tmpl ├── default.php └── index.html └── view.html.php /README.md: -------------------------------------------------------------------------------- 1 | # ImproveMyCity - Citizens Requests, Complaints & Suggestions 2 | 3 | ![Screenshots from the application](http://smartcityapps.urenio.org/img/screens_improve_en.png) 4 | 5 | ImproveMyCity is a Joomla 2.5.x extension to report, vote and track non-emergency issues. 6 | 7 | The application enables citizens to report local problems such as potholes, illegal trash dumping, faulty street lights, broken tiles on sidewalks, and illegal advertising boards. The submitted issues are displayed on the city's map. Users may add photos and comments. Moreover, they can suggest solutions for improving the environment of their neighbourhood. 8 | 9 | ImproveMyCity has been developed within the European project PEOPLE. Find out more at [http://www.improve-my-city.com/](http://www.improve-my-city.com/). 10 | 11 | ImproveMyCity is also available on the [Joomla! Extensions Directory](http://extensions.joomla.org/extensions/clients-a-communities/communities/21164) 12 | 13 | ## Installation and Documentation 14 | Refer to ImproveMyCity [wiki pages](https://github.com/icos-urenio/Improve-my-city/wiki). 15 | 16 | ## Bug Tracker 17 | Have a bug? Please create an issue here on GitHub! 18 | [https://github.com/icos-urenio/Improve-my-city/issues](https://github.com/icos-urenio/Improve-my-city/issues). 19 | 20 | ## License 21 | ImproveMyCity's source code is licensed under the [GNU Affero General Public License](https://www.gnu.org/licenses/agpl.html). 22 | 23 | ## Changelog 24 | 25 | ### Version 2.6.0 26 | * Various fixes and improvements 27 | 28 | ### Version 2.5.9 29 | * Added pagination, filtering and search on report 30 | 31 | ### Version 2.5.8 32 | * Social tags introduced (mainly used by mobile apps) 33 | * Creating default object from empty value fix 34 | * Limit box show all issues added on settings 35 | 36 | ### Version 2.5.7 37 | * Authentication compatibility according to PHPass as introduced in Joomla concerning the JSON controller 38 | 39 | ### Version 2.5.6 40 | * Problem adding new issue when IMC is set on Home menu is fixed 41 | 42 | ### Version 2.5.5 43 | * Menu parameter HTML5 to select between the old classic layout and the new responsive based on bootstrap and html5 44 | * Include latest bootstrap 45 | 46 | ### Version 2.5.4 47 | * Major update to support adaptive layout using Bootstrap's row-fluid 48 | * Problem loading map on latest Chrome version is fixed 49 | * New field to keep track of how issues are inserted (normal/json) 50 | 51 | ### Version 2.5.3 52 | * REST secure user registration following com_users guidelines completed 53 | * Ready for SSL 54 | * Trash / empty trash issues on administrator is fixed 55 | * Various bootstrap issues fixed 56 | * jQuery and popup modal conflict issues fixed 57 | * Ordering issue occuring in some templates is fixed 58 | 59 | ### Version 2.5.2 60 | * Fixing upload photo server-path when adding new issue from mobile.json 61 | * Added getUserVotes() in mobile.json 62 | 63 | ### Version 2.5.1 security update 64 | * Security update concerning encryption/decryption. The method is now Android compatible 65 | * Secret key is now stored on DB instead of component's parameters 66 | * Administrator various fixes and submenus added 67 | * Updated mobile.json controller according to this [snippet](http://www.androidsnippets.com/encrypt-decrypt-between-android-and-php) 68 | 69 | ### Version 2.5.0 70 | Brings complete support for mobile versions (Android, iOS, REST services) of ImproveMyCity, for third parties, by introducing a complete json wrapper. All gathered together through a common controller interface which administrators can activate/deactivate on demand. 71 | 72 | Mobile json wrapping supports: 73 | 74 | - Encryption / Decryption functionality with secret key defined on server side 75 | - Timestamp on DB changes 76 | - Introduces geo-boundaries queries 77 | 78 | Also v2.5.0 brings the following: 79 | - New settings for displaying relative dates or plain dates with custom date format 80 | - New settings to enable/disable json support for the new mobile-oriented controller 81 | - Secret key on settings to be used for password encryption over http (It is highly recommended to use HTTPS) 82 | - Remove login link on add new issue and add new comment 83 | - Mega-menu css enhancements 84 | - Fix administration approval issues (you can set on settings if you want to publish directly new issues or the administrator must first approve) 85 | 86 | ### Version 2.4.0 87 | * Just a numbering convension to 3 level versioning 88 | 89 | ### Version 2.3 90 | * Fixes the conflict between mootools/jquery which caused megamenu or/and google map not to work when certain templates are used. 91 | 92 | ### Version 2.2.1 93 | * Introduces automatic updates and also improves comments administration and fixes dropdown categories bug concerning unpublished items 94 | 95 | ### Version 2.2 96 | * Introduces comments administration and suggestions and bug fixes based on JED and support group users. Also, new settings are added like: Show/Hide comments, Publish new issue on admin approval and more. Settings are now fully translated. Comment submit button is disabled during ajax call to avoid duplicate comments. 97 | 98 | ### Version 2.1 99 | * Fixes some ACL features 100 | 101 | ### Version 2.0 102 | * Contains many additions and bug fixes based on end-users comments and testing phase feedback 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | -------------------------------------------------------------------------------- /administrator/access.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 |
12 | 13 | 14 | 15 | 16 |
17 |
18 | -------------------------------------------------------------------------------- /administrator/controller.php: -------------------------------------------------------------------------------- 1 | view_list = 'comments'; 23 | parent::__construct(); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /administrator/controllers/comments.php: -------------------------------------------------------------------------------- 1 | true)); 27 | 28 | return $model; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /administrator/controllers/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/controllers/issue.php: -------------------------------------------------------------------------------- 1 | view_list = 'issues'; 23 | parent::__construct(); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /administrator/controllers/issues.php: -------------------------------------------------------------------------------- 1 | true)); 27 | return $model; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /administrator/controllers/key.php: -------------------------------------------------------------------------------- 1 | view_list = 'keys'; 23 | parent::__construct(); 24 | 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /administrator/controllers/keys.php: -------------------------------------------------------------------------------- 1 | true)); 27 | 28 | return $model; 29 | } 30 | 31 | public function updateCategoryTimestamp() 32 | { 33 | //get model and categories 34 | $model = $this->getModel('keys'); 35 | $updated = $model->updateCategoryTimestamp(); 36 | $this->setRedirect("index.php?option=com_improvemycity&view=keys"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /administrator/helpers/improvemycity.php: -------------------------------------------------------------------------------- 1 | addStyleDeclaration('.icon-48-item {background-image: url(../media/com_improvemycity/images/improvemycity-48x48.png);}'); 53 | $document->addStyleDeclaration('.icon-48-items {background-image: url(../media/com_improvemycity/images/improvemycity-48x48.png);}'); 54 | if ($vName == 'categories') 55 | { 56 | $document->setTitle(JText::_('COM_IMPROVEMYCITY_ADMINISTRATION_CATEGORIES')); 57 | } 58 | } 59 | 60 | /** 61 | * Gets a list of the actions that can be performed. 62 | * 63 | * @return JObject 64 | * @since 1.6 65 | */ 66 | public static function getActions() 67 | { 68 | $user = JFactory::getUser(); 69 | $result = new JObject; 70 | 71 | $assetName = 'com_improvemycity'; 72 | 73 | $actions = array( 74 | 'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.own', 'core.edit.state', 'core.delete' 75 | ); 76 | 77 | foreach ($actions as $action) { 78 | $result->set($action, $user->authorise($action, $assetName)); 79 | } 80 | 81 | return $result; 82 | } 83 | } 84 | -------------------------------------------------------------------------------- /administrator/helpers/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/improvemycity.php: -------------------------------------------------------------------------------- 1 | authorise('core.manage', 'com_improvemycity')) { 16 | return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); 17 | } 18 | 19 | // require helper file 20 | JLoader::register('ImprovemycityHelper', dirname(__FILE__) . DS . 'helpers' . DS . 'improvemycity.php'); 21 | 22 | // Include dependancies 23 | jimport('joomla.application.component.controller'); 24 | 25 | $controller = JController::getInstance('Improvemycity'); 26 | $controller->execute(JRequest::getCmd('task')); 27 | $controller->redirect(); 28 | -------------------------------------------------------------------------------- /administrator/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/language/el-GR.com_improvemycity.sys.ini: -------------------------------------------------------------------------------- 1 | COM_IMPROVEMYCITY="Βελτιώνω την Πόλη μου" 2 | COM_IMPROVEMYCITY_XML_DESCRIPTION="Βελτιώνω την πόλη μου: Αιτήματα - Παράπονα - Προτάσεις. \nΟι εφαρμογή αναπτύσσεται στα πλαίσια του Ευρωπαϊκού Έργου PEOPLE: «Ευφυή αστικά οικοσυστήματα ανοιχτής καινοτομίας για προώθηση μελλοντικών υπηρεσιών» που συγχρηματοδοτείται από την Ευρωπαϊκή Επιτροπή (THEME [CIP-ICT-PSP.2010.4.1])." 3 | COM_IMPROVEMYCITY_ITEMS="Συμβάντα" 4 | COM_IMPROVEMYCITY_CATEGORIES="Κατηγορίες συμβάντων" 5 | COM_IMPROVEMYCITY_IMPROVEMYCITY_VIEW_DEFAULT_TITLE="Βελτιώνω την πόλη μου: Προεπιλεγμένη προβολή λίστας" 6 | COM_IMPROVEMYCITY_IMPROVEMYCITY_VIEW_DEFAULT_DESC="Αυτή η προβολή εμφανίζει τον προεπιλεγμένο τρόπο εμφάνισης των συμβαντων" 7 | COM_IMPROVEMYCITY_ISSUES_VIEW_DEFAULT_TITLE="Προεπιλεγμένη προβολή λίστας" 8 | 9 | COM_IMPROVEMYCITY_COMMENTS="Σχόλια" 10 | COM_IMPROVEMYCITY_REPORTS="Αναφορές" 11 | COM_IMPROVEMYCITY_KEYS="Κλειδιά API" -------------------------------------------------------------------------------- /administrator/language/en-GB.com_improvemycity.sys.ini: -------------------------------------------------------------------------------- 1 | COM_IMPROVEMYCITY="Improve My City" 2 | COM_IMPROVEMYCITY_XML_DESCRIPTION="ImproveMyCity - Report, vote and track non-emergency issues. ImproveMyCity was developed within the European project "PEOPLE: Pilot smart urban Ecosystems leveraging Open innovation for Promoting and enabLing future E- services" which is co-financed by the European Commission (THEME [CIP-ICT-PSP.2010.4.1])." 3 | COM_IMPROVEMYCITY_ITEMS="Issues" 4 | COM_IMPROVEMYCITY_CATEGORIES="Issue Categories" 5 | COM_IMPROVEMYCITY_IMPROVEMYCITY_VIEW_DEFAULT_TITLE="ImproveMyCity: Default List view" 6 | COM_IMPROVEMYCITY_IMPROVEMYCITY_VIEW_DEFAULT_DESC="This view displays the default Improve My City view" 7 | COM_IMPROVEMYCITY_ISSUES_VIEW_DEFAULT_TITLE="Default List View" 8 | 9 | COM_IMPROVEMYCITY_COMMENTS="Comments" 10 | COM_IMPROVEMYCITY_REPORTS="Reports" 11 | COM_IMPROVEMYCITY_KEYS="API Keys" -------------------------------------------------------------------------------- /administrator/language/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /administrator/models/comment.php: -------------------------------------------------------------------------------- 1 | loadForm('com_improvemycity.comment', 'comment', array('control' => 'jform', 'load_data' => $loadData)); 56 | if (empty($form)) { 57 | return false; 58 | } 59 | 60 | return $form; 61 | } 62 | 63 | /** 64 | * Method to get the data that should be injected in the form. 65 | * 66 | * @return mixed The data for the form. 67 | * @since 1.6 68 | */ 69 | protected function loadFormData() 70 | { 71 | // Check the session for previously entered form data. 72 | $data = JFactory::getApplication()->getUserState('com_improvemycity.edit.comment.data', array()); 73 | 74 | if (empty($data)) { 75 | $data = $this->getItem(); 76 | } 77 | 78 | return $data; 79 | } 80 | 81 | /** 82 | * Method to get a single record. 83 | * 84 | * @param integer The id of the primary key. 85 | * 86 | * @return mixed Object on success, false on failure. 87 | * @since 1.6 88 | */ 89 | public function getItem($pk = null) 90 | { 91 | if ($item = parent::getItem($pk)) { 92 | //Do any procesing on fields here if needed 93 | } 94 | 95 | return $item; 96 | } 97 | 98 | /** 99 | * Prepare and sanitise the table prior to saving. 100 | * 101 | * @since 1.6 102 | */ 103 | protected function prepareTable(&$table) 104 | { 105 | jimport('joomla.filter.output'); 106 | 107 | if (empty($table->id)) { 108 | 109 | // Set ordering to the last item if not set 110 | if (@$table->ordering === '') { 111 | $db = JFactory::getDbo(); 112 | $db->setQuery('SELECT MAX(ordering) FROM #__improvemycity_comments'); 113 | $max = $db->loadResult(); 114 | $table->ordering = $max+1; 115 | } 116 | $table->reported = date('Y-m-d H:i:s'); 117 | } 118 | 119 | 120 | if($table->reported == '0000-00-00 00:00:00'){ 121 | $table->reported = date('Y-m-d H:i:s'); 122 | $table->acknowledged = '0000-00-00 00:00:00'; 123 | $table->closed = '0000-00-00 00:00:00'; 124 | } 125 | 126 | if($table->currentstatus == '2'){ 127 | if($table->acknowledged == '0000-00-00 00:00:00'){ 128 | $table->acknowledged = date('Y-m-d H:i:s'); 129 | $table->closed = '0000-00-00 00:00:00'; 130 | } 131 | } 132 | if($table->currentstatus == '3'){ 133 | if($table->closed == '0000-00-00 00:00:00'){ 134 | $table->closed = date('Y-m-d H:i:s'); 135 | } 136 | 137 | } 138 | 139 | $user =& JFactory::getUser(); 140 | $table->userid = $user->id; 141 | 142 | } 143 | 144 | } 145 | -------------------------------------------------------------------------------- /administrator/models/comments.php: -------------------------------------------------------------------------------- 1 | getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); 56 | $this->setState('filter.search', $search); 57 | 58 | $published = $app->getUserStateFromRequest($this->context.'.filter.state', 'filter_published', '', 'string'); 59 | $this->setState('filter.state', $published); 60 | 61 | // Load the parameters. 62 | $params = JComponentHelper::getParams('com_improvemycity'); 63 | $this->setState('params', $params); 64 | 65 | // List state information. 66 | parent::populateState('a.id', 'asc'); 67 | } 68 | 69 | /** 70 | * Method to get a store id based on model configuration state. 71 | * 72 | * This is necessary because the model is used by the component and 73 | * different modules that might need different sets of data or different 74 | * ordering requirements. 75 | * 76 | * @param string $id A prefix for the store id. 77 | * @return string A store id. 78 | * @since 1.6 79 | */ 80 | protected function getStoreId($id = '') 81 | { 82 | // Compile the store id. 83 | $id.= ':' . $this->getState('filter.search'); 84 | $id.= ':' . $this->getState('filter.state'); 85 | 86 | return parent::getStoreId($id); 87 | } 88 | 89 | /** 90 | * Build an SQL query to load the list data. 91 | * 92 | * @return JDatabaseQuery 93 | * @since 1.6 94 | */ 95 | protected function getListQuery() 96 | { 97 | // Create a new query object. 98 | $db = $this->getDbo(); 99 | $query = $db->getQuery(true); 100 | 101 | // Select the required fields from the table. 102 | $query->select( 103 | $this->getState( 104 | 'list.select', 105 | 'a.*, #__improvemycity.title as issuetitle, #__users.name as user' 106 | ) 107 | ); 108 | $query->from('`#__improvemycity_comments` AS a'); 109 | $query->leftJoin('#__improvemycity on improvemycityid=#__improvemycity.id'); 110 | $query->leftJoin('#__users on a.userid=#__users.id'); 111 | 112 | // Filter by search in title 113 | $search = $this->getState('filter.search'); 114 | if (!empty($search)) { 115 | if (stripos($search, 'id:') === 0) { 116 | $query->where('a.id = '.(int) substr($search, 3)); 117 | } else { 118 | $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); 119 | $query->where('(a.description LIKE '.$search.')'); 120 | } 121 | } 122 | 123 | // Add the list ordering clause. 124 | $orderCol = $this->state->get('list.ordering'); 125 | $orderDirn = $this->state->get('list.direction'); 126 | if ($orderCol && $orderDirn) { 127 | $query->order($db->getEscaped($orderCol.' '.$orderDirn)); 128 | } 129 | 130 | return $query; 131 | } 132 | } 133 | -------------------------------------------------------------------------------- /administrator/models/fields/custom_field.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/models/forms/comment.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 8 | 9 | 10 | 11 | 25 | 26 | 30 |
31 | 32 |
33 | -------------------------------------------------------------------------------- /administrator/models/forms/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/models/forms/issue.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 8 | 18 | 28 | 29 | 30 | 31 | 41 | 51 | 61 | 75 | 82 | 92 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 113 | 114 | 115 | 116 | 117 | 121 | 122 | 126 | 127 | 131 | 132 | 133 | 134 | 138 |
139 | 140 |
141 | -------------------------------------------------------------------------------- /administrator/models/forms/key.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 8 | 17 | 18 |
19 | 20 |
21 | -------------------------------------------------------------------------------- /administrator/models/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/models/issues.php: -------------------------------------------------------------------------------- 1 | getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); 56 | $this->setState('filter.search', $search); 57 | 58 | $published = $this->getUserStateFromRequest($this->context.'.filter.published', 'filter_published', ''); 59 | $this->setState('filter.published', $published); 60 | 61 | $categoryId = $this->getUserStateFromRequest($this->context.'.filter.category_id', 'filter_category_id'); 62 | $this->setState('filter.category_id', $categoryId); 63 | 64 | $currentstatus = $app->getUserStateFromRequest($this->context.'.filter.currentstatus', 'filter_currentstatus'); 65 | $this->setState('filter.currentstatus', $currentstatus); 66 | 67 | // Load the parameters. 68 | $params = JComponentHelper::getParams('com_improvemycity'); 69 | $this->setState('params', $params); 70 | 71 | // List state information. 72 | parent::populateState('a.id', 'desc'); 73 | } 74 | 75 | /** 76 | * Method to get a store id based on model configuration state. 77 | * 78 | * This is necessary because the model is used by the component and 79 | * different modules that might need different sets of data or different 80 | * ordering requirements. 81 | * 82 | * @param string $id A prefix for the store id. 83 | * @return string A store id. 84 | * @since 1.6 85 | */ 86 | protected function getStoreId($id = '') 87 | { 88 | // Compile the store id. 89 | $id.= ':' . $this->getState('filter.search'); 90 | $id.= ':' . $this->getState('filter.currentstatus'); 91 | $id.= ':' . $this->getState('filter.state'); 92 | $id .= ':'.$this->getState('filter.published'); 93 | $id .= ':'.$this->getState('filter.category_id'); 94 | return parent::getStoreId($id); 95 | } 96 | 97 | /** 98 | * Build an SQL query to load the list data. 99 | * 100 | * @return JDatabaseQuery 101 | * @since 1.6 102 | */ 103 | protected function getListQuery() 104 | { 105 | // Create a new query object. 106 | $db = $this->getDbo(); 107 | $query = $db->getQuery(true); 108 | 109 | // Select the required fields from the table. 110 | $query->select( 111 | $this->getState( 112 | 'list.select', 113 | 'a.*, #__categories.title as category,catid, #__categories.path as path' 114 | ) 115 | ); 116 | $query->from('`#__improvemycity` AS a'); 117 | $query->leftJoin('#__categories on catid=#__categories.id'); 118 | 119 | 120 | 121 | 122 | // Filter by search in title 123 | $search = $this->getState('filter.search'); 124 | if (!empty($search)) { 125 | if (stripos($search, 'id:') === 0) { 126 | $query->where('a.id = '.(int) substr($search, 3)); 127 | } else { 128 | $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); 129 | $query->where('(a.title LIKE '.$search.')'); 130 | } 131 | } 132 | 133 | // Filter by a single or group of categories. 134 | $baselevel = 1; 135 | $categoryId = $this->getState('filter.category_id'); 136 | if (is_numeric($categoryId)) { 137 | $query->where('a.catid IN ('.$categoryId.')'); 138 | } 139 | 140 | // Filter by published state 141 | $published = $this->getState('filter.published'); 142 | if (is_numeric($published)) { 143 | $query->where('a.state = ' . (int) $published); 144 | } 145 | elseif ($published === '') { 146 | $query->where('(a.state = 0 OR a.state = 1)'); 147 | } 148 | 149 | // Filter by currentstatus 150 | $currentstatus = $this->getState('filter.currentstatus'); 151 | if (is_numeric($currentstatus) && $currentstatus > 0) { 152 | $query->where('a.currentstatus IN ('.$currentstatus.')'); 153 | } 154 | 155 | // Add the list ordering clause. 156 | $orderCol = $this->state->get('list.ordering'); 157 | $orderDirn = $this->state->get('list.direction'); 158 | if ($orderCol && $orderDirn) { 159 | $query->order($db->getEscaped($orderCol.' '.$orderDirn)); 160 | } 161 | 162 | return $query; 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /administrator/models/key.php: -------------------------------------------------------------------------------- 1 | loadForm('com_improvemycity.key', 'key', array('control' => 'jform', 'load_data' => $loadData)); 56 | if (empty($form)) { 57 | return false; 58 | } 59 | 60 | return $form; 61 | } 62 | 63 | /** 64 | * Method to get the data that should be injected in the form. 65 | * 66 | * @return mixed The data for the form. 67 | * @since 1.6 68 | */ 69 | protected function loadFormData() 70 | { 71 | // Check the session for previously entered form data. 72 | $data = JFactory::getApplication()->getUserState('com_improvemycity.edit.key.data', array()); 73 | 74 | if (empty($data)) { 75 | $data = $this->getItem(); 76 | } 77 | 78 | return $data; 79 | } 80 | 81 | /** 82 | * Method to get a single record. 83 | * 84 | * @param integer The id of the primary key. 85 | * 86 | * @return mixed Object on success, false on failure. 87 | * @since 1.6 88 | */ 89 | public function getItem($pk = null) 90 | { 91 | if ($item = parent::getItem($pk)) { 92 | //Do any procesing on fields here if needed 93 | } 94 | 95 | return $item; 96 | } 97 | 98 | /** 99 | * Prepare and sanitise the table prior to saving. 100 | * 101 | * @since 1.6 102 | */ 103 | protected function prepareTable(&$table) 104 | { 105 | jimport('joomla.filter.output'); 106 | 107 | if (empty($table->id)) { 108 | 109 | // Set ordering to the last item if not set 110 | if (@$table->ordering === '') { 111 | $db = JFactory::getDbo(); 112 | $db->setQuery('SELECT MAX(ordering) FROM #__improvemycity_keys'); 113 | $max = $db->loadResult(); 114 | $table->ordering = $max+1; 115 | } 116 | } 117 | 118 | } 119 | 120 | } 121 | -------------------------------------------------------------------------------- /administrator/models/keys.php: -------------------------------------------------------------------------------- 1 | getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); 54 | $this->setState('filter.search', $search); 55 | 56 | $published = $app->getUserStateFromRequest($this->context.'.filter.state', 'filter_published', '', 'string'); 57 | $this->setState('filter.state', $published); 58 | 59 | // Load the parameters. 60 | $params = JComponentHelper::getParams('com_improvemycity'); 61 | $this->setState('params', $params); 62 | 63 | // List state information. 64 | parent::populateState('a.id', 'asc'); 65 | } 66 | 67 | /** 68 | * Method to get a store id based on model configuration state. 69 | * 70 | * This is necessary because the model is used by the component and 71 | * different modules that might need different sets of data or different 72 | * ordering requirements. 73 | * 74 | * @param string $id A prefix for the store id. 75 | * @return string A store id. 76 | * @since 1.6 77 | */ 78 | protected function getStoreId($id = '') 79 | { 80 | // Compile the store id. 81 | $id.= ':' . $this->getState('filter.search'); 82 | $id.= ':' . $this->getState('filter.state'); 83 | 84 | return parent::getStoreId($id); 85 | } 86 | 87 | /** 88 | * Build an SQL query to load the list data. 89 | * 90 | * @return JDatabaseQuery 91 | * @since 1.6 92 | */ 93 | protected function getListQuery() 94 | { 95 | // Create a new query object. 96 | $db = $this->getDbo(); 97 | $query = $db->getQuery(true); 98 | 99 | // Select the required fields from the table. 100 | $query->select( 101 | $this->getState( 102 | 'list.select', 103 | 'a.*' 104 | ) 105 | ); 106 | $query->from('`#__improvemycity_keys` AS a'); 107 | 108 | // Filter by key in title 109 | $search = $this->getState('filter.search'); 110 | if (!empty($search)) { 111 | if (stripos($search, 'id:') === 0) { 112 | $query->where('a.id = '.(int) substr($search, 3)); 113 | } else { 114 | $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); 115 | $query->where('(a.skey LIKE '.$search.')'); 116 | } 117 | } 118 | 119 | // Add the list ordering clause. 120 | $orderCol = $this->state->get('list.ordering'); 121 | $orderDirn = $this->state->get('list.direction'); 122 | if ($orderCol && $orderDirn) { 123 | $query->order($db->getEscaped($orderCol.' '.$orderDirn)); 124 | } 125 | 126 | return $query; 127 | } 128 | 129 | /* since 2.5.3 130 | * update category timestamp on table timestamp to notify Android application for changes in DB 131 | * */ 132 | public function updateCategoryTimestamp() 133 | { 134 | $db = $this->getDbo(); 135 | $db->setQuery( 136 | 'UPDATE #__improvemycity_timestamp' . 137 | ' SET triggered = MD5(RAND())' . 138 | ' WHERE id = 2' 139 | ); 140 | 141 | if (!$db->query()) { 142 | $this->setError($db->getErrorMsg()); 143 | return false; 144 | } 145 | 146 | return true; 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /administrator/models/reports.php: -------------------------------------------------------------------------------- 1 | getUserStateFromRequest($this->context.'.filter.search', 'filter_search'); 56 | $this->setState('filter.search', $search); 57 | 58 | //no need since query selects only of status=1 59 | //$published = $app->getUserStateFromRequest($this->context.'.filter.state', 'filter_published', '', 'string'); 60 | //$this->setState('filter.state', $published); 61 | 62 | $currentstatus = $app->getUserStateFromRequest($this->context.'.filter.currentstatus', 'filter_currentstatus'); 63 | $this->setState('filter.currentstatus', $currentstatus); 64 | 65 | $categoryId = $this->getUserStateFromRequest($this->context.'.filter.category_id', 'filter_category_id'); 66 | $this->setState('filter.category_id', $categoryId); 67 | 68 | // Load the parameters. 69 | $params = JComponentHelper::getParams('com_improvemycity'); 70 | $this->setState('params', $params); 71 | // List state information. 72 | parent::populateState('a.id', 'desc'); 73 | } 74 | 75 | /** 76 | * Method to get a store id based on model configuration state. 77 | * 78 | * This is necessary because the model is used by the component and 79 | * different modules that might need different sets of data or different 80 | * ordering requirements. 81 | * 82 | * @param string $id A prefix for the store id. 83 | * @return string A store id. 84 | * @since 1.6 85 | */ 86 | protected function getStoreId($id = '') 87 | { 88 | // Compile the store id. 89 | $id.= ':' . $this->getState('filter.search'); 90 | $id.= ':' . $this->getState('filter.currentstatus'); 91 | $id.= ':'.$this->getState('filter.category_id'); 92 | return parent::getStoreId($id); 93 | } 94 | 95 | /** 96 | * Build an SQL query to load the list data. 97 | * 98 | * @return JDatabaseQuery 99 | * @since 1.6 100 | */ 101 | protected function getListQuery() 102 | { 103 | // Create a new query object. 104 | $db = $this->getDbo(); 105 | $query = $db->getQuery(true); 106 | 107 | // Select the required fields from the table. 108 | $query->select( 109 | $this->getState( 110 | 'list.select', 111 | 'a.*, #__categories.title AS category,catid, #__users.name AS username' 112 | ) 113 | ); 114 | 115 | $query->from('#__improvemycity AS a'); 116 | $query->leftJoin('#__categories on a.catid=#__categories.id'); 117 | $query->leftJoin('#__users on a.userid=#__users.id'); 118 | $query->where('a.state = 1'); 119 | 120 | 121 | // Filter by search in title 122 | $search = $this->getState('filter.search'); 123 | if (!empty($search)) { 124 | if (stripos($search, 'id:') === 0) { 125 | $query->where('a.id = '.(int) substr($search, 3)); 126 | } else { 127 | $search = $db->Quote('%'.$db->getEscaped($search, true).'%'); 128 | $query->where('(a.description LIKE '.$search.' OR a.title LIKE '.$search.')'); 129 | } 130 | } 131 | 132 | // Filter by date 133 | if($this->getState('filter.from')){ 134 | $query->where('a.reported > "'. $this->getState('filter.from'). '"'); 135 | } 136 | if($this->getState('filter.to')){ 137 | $query->where('a.reported < "'. $this->getState('filter.to'). '"'); 138 | } 139 | 140 | // Filter by category 141 | $categoryId = $this->getState('filter.category_id'); 142 | if (is_numeric($categoryId)) { 143 | $query->where('a.catid IN ('.$categoryId.')'); 144 | } 145 | 146 | // Filter by currentstatus 147 | $currentstatus = $this->getState('filter.currentstatus'); 148 | if (is_numeric($currentstatus)) { 149 | $query->where('a.currentstatus = '.$currentstatus); 150 | } 151 | 152 | // Add the list ordering clause. 153 | $orderCol = $this->state->get('list.ordering'); 154 | $orderDirn = $this->state->get('list.direction', 'desc'); 155 | if ($orderCol && $orderDirn) { 156 | $query->order($db->getEscaped($orderCol.' '.$orderDirn)); 157 | } 158 | 159 | return $query; 160 | } 161 | 162 | public function getStatistics() 163 | { 164 | $db = $this->getDbo(); 165 | $query = $this->getListQuery(); 166 | $query->select ('COUNT(a.currentstatus) AS counter'); 167 | $query->group('a.currentstatus'); 168 | $db->setQuery($query); 169 | $results = $db->loadAssocList(); 170 | 171 | $counter1 = 0; 172 | $counter2 = 0; 173 | $counter3 = 0; 174 | foreach ($results as $result) { 175 | if($result['currentstatus'] == 1) 176 | $counter1 = $result['counter']; 177 | if($result['currentstatus'] == 2) 178 | $counter2 = $result['counter']; 179 | if($result['currentstatus'] == 3) 180 | $counter3 = $result['counter']; 181 | } 182 | $ret = array('open'=>$counter1, 'ack'=>$counter2, 'closed'=>$counter3); 183 | return $ret; 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /administrator/models/rules/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /administrator/models/rules/title.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /administrator/sql/install.mysql.utf8.sql: -------------------------------------------------------------------------------- 1 | 2 | CREATE TABLE IF NOT EXISTS `#__improvemycity` ( 3 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 4 | `title` varchar(100) NOT NULL, 5 | `catid` int(11) NOT NULL DEFAULT '0', 6 | `latitude` varchar(20) NOT NULL, 7 | `longitude` varchar(20) NOT NULL, 8 | `description` text, 9 | `photo` text, 10 | `address` text, 11 | `votes` int(11) NOT NULL DEFAULT '1', 12 | `currentstatus` int(11) NOT NULL DEFAULT '1', 13 | `reported` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 14 | `acknowledged` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 15 | `closed` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 16 | `userid` int(11) NOT NULL DEFAULT '0', 17 | `ordering` int(11) NOT NULL DEFAULT '0', 18 | `params` text NOT NULL, 19 | `state` tinyint(3) NOT NULL DEFAULT '1', 20 | `language` char(7) NOT NULL, 21 | `hits` int(10) NOT NULL, 22 | `inserted_by` INT NOT NULL DEFAULT '0', 23 | PRIMARY KEY (`id`) 24 | ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT COLLATE=utf8_general_ci; 25 | 26 | CREATE TABLE IF NOT EXISTS `#__improvemycity_progress` ( 27 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 28 | `improvemycityid` int(11) NOT NULL DEFAULT '0', 29 | `status` int(11) NOT NULL DEFAULT '0', 30 | `userid` int(11) NOT NULL DEFAULT '0', 31 | `description` text, 32 | `ordering` int(11) NOT NULL DEFAULT '0', 33 | `progressdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 34 | `state` tinyint(3) NOT NULL DEFAULT '1', 35 | PRIMARY KEY (`id`) 36 | ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT COLLATE=utf8_general_ci; 37 | 38 | CREATE TABLE IF NOT EXISTS `#__improvemycity_votes` ( 39 | `id` int(11) NOT NULL AUTO_INCREMENT, 40 | `improvemycityid` int(11) NOT NULL, 41 | `userid` int(11) NOT NULL, 42 | `votingdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 43 | `state` tinyint(3) NOT NULL DEFAULT '1', 44 | PRIMARY KEY (`id`) 45 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; 46 | 47 | CREATE TABLE IF NOT EXISTS `#__improvemycity_comments` ( 48 | `id` int(11) NOT NULL AUTO_INCREMENT, 49 | `improvemycityid` int(11) NOT NULL, 50 | `userid` int(11) NOT NULL, 51 | `created` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 52 | `description` text NOT NULL, 53 | `image` varchar(255) NOT NULL, 54 | `state` tinyint(3) NOT NULL DEFAULT '1', 55 | `reported` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', 56 | PRIMARY KEY (`id`) 57 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; 58 | 59 | CREATE TABLE IF NOT EXISTS `#__improvemycity_timestamp` ( 60 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 61 | `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 62 | `triggered` varchar(255), 63 | PRIMARY KEY (`id`) 64 | ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT COLLATE=utf8_general_ci; 65 | 66 | INSERT INTO `#__improvemycity_timestamp` (`triggered`) VALUES (MD5(RAND())); 67 | INSERT INTO `#__improvemycity_timestamp` (`triggered`) VALUES (MD5(RAND())); 68 | 69 | CREATE TABLE IF NOT EXISTS `#__improvemycity_keys` ( 70 | `id` int(11) NOT NULL AUTO_INCREMENT, 71 | `skey` varchar(16) NOT NULL, 72 | PRIMARY KEY (`id`) 73 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; 74 | 75 | INSERT INTO `#__improvemycity_keys` (`skey`) VALUES ('1234567890123456'); -------------------------------------------------------------------------------- /administrator/sql/uninstall.mysql.utf8.sql: -------------------------------------------------------------------------------- 1 | DROP TABLE IF EXISTS `#__improvemycity`; 2 | DROP TABLE IF EXISTS `#__improvemycity_progress`; 3 | DROP TABLE IF EXISTS `#__improvemycity_votes`; 4 | DROP TABLE IF EXISTS `#__improvemycity_comments`; 5 | DROP TABLE IF EXISTS `#__improvemycity_timestamp`; 6 | DROP TABLE IF EXISTS `#__improvemycity_keys`; -------------------------------------------------------------------------------- /administrator/sql/updates/mysql/2.2.sql: -------------------------------------------------------------------------------- 1 | #2.2 -------------------------------------------------------------------------------- /administrator/sql/updates/mysql/2.4.1.sql: -------------------------------------------------------------------------------- 1 | #version 2.4.1 introduces timestamp table to be used by native android application 2 | 3 | CREATE TABLE IF NOT EXISTS `#__improvemycity_timestamp` ( 4 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 5 | `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 6 | `triggered` varchar(255), 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT COLLATE=utf8_general_ci; 9 | 10 | -------------------------------------------------------------------------------- /administrator/sql/updates/mysql/2.5.0.sql: -------------------------------------------------------------------------------- 1 | #2.5.0 2 | DROP TABLE IF EXISTS `#__improvemycity_timestamp`; 3 | CREATE TABLE `#__improvemycity_timestamp` ( 4 | `id` int(11) unsigned NOT NULL AUTO_INCREMENT, 5 | `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, 6 | `triggered` varchar(255), 7 | PRIMARY KEY (`id`) 8 | ) ENGINE=MyISAM AUTO_INCREMENT=0 DEFAULT COLLATE=utf8_general_ci; 9 | INSERT INTO `#__improvemycity_timestamp` (`triggered`) VALUES (MD5(RAND())); -------------------------------------------------------------------------------- /administrator/sql/updates/mysql/2.5.1.sql: -------------------------------------------------------------------------------- 1 | #2.5.1 2 | DROP TABLE IF EXISTS `#__improvemycity_keys`; 3 | CREATE TABLE `#__improvemycity_keys` ( 4 | `id` int(11) NOT NULL AUTO_INCREMENT, 5 | `skey` varchar(16) NOT NULL, 6 | PRIMARY KEY (`id`) 7 | ) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=0 ; 8 | 9 | INSERT INTO `#__improvemycity_keys` (`skey`) VALUES ('1234567890123456'); -------------------------------------------------------------------------------- /administrator/sql/updates/mysql/2.5.3.sql: -------------------------------------------------------------------------------- 1 | #2.5.3 2 | INSERT INTO `#__improvemycity_timestamp` (`id`,`triggered`) VALUES (2, MD5(RAND())); -------------------------------------------------------------------------------- /administrator/sql/updates/mysql/2.5.4.sql: -------------------------------------------------------------------------------- 1 | #2.5.4 2 | ALTER TABLE `#__improvemycity` ADD `inserted_by` INT NOT NULL DEFAULT '0' -------------------------------------------------------------------------------- /administrator/tables/comment.php: -------------------------------------------------------------------------------- 1 | loadArray($array['params']); 44 | $array['params'] = (string)$registry; 45 | } 46 | 47 | if (isset($array['metadata']) && is_array($array['metadata'])) { 48 | $registry = new JRegistry(); 49 | $registry->loadArray($array['metadata']); 50 | $array['metadata'] = (string)$registry; 51 | } 52 | return parent::bind($array, $ignore); 53 | } 54 | 55 | /** 56 | * Overloaded check function 57 | */ 58 | public function check() { 59 | 60 | //If there is an ordering column and this is a new row then get the next ordering value 61 | if (property_exists($this, 'ordering') && $this->id == 0) { 62 | $this->ordering = self::getNextOrder(); 63 | } 64 | 65 | return parent::check(); 66 | } 67 | 68 | 69 | /** 70 | * Method to set the publishing state for a row or list of rows in the database 71 | * table. The method respects checked out rows by other users and will attempt 72 | * to checkin rows that it can after adjustments are made. 73 | * 74 | * @param mixed An optional array of primary key values to update. If not 75 | * set the instance property value is used. 76 | * @param integer The publishing state. eg. [0 = unpublished, 1 = published] 77 | * @param integer The user id of the user performing the operation. 78 | * @return boolean True on success. 79 | * @since 1.0.4 80 | */ 81 | public function publish($pks = null, $state = 1, $userId = 0) 82 | { 83 | // Initialise variables. 84 | $k = $this->_tbl_key; 85 | 86 | // Sanitize input. 87 | JArrayHelper::toInteger($pks); 88 | $userId = (int) $userId; 89 | $state = (int) $state; 90 | 91 | // If there are no primary keys set check to see if the instance key is set. 92 | if (empty($pks)) 93 | { 94 | if ($this->$k) { 95 | $pks = array($this->$k); 96 | } 97 | // Nothing to set publishing state on, return false. 98 | else { 99 | $this->setError(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED')); 100 | return false; 101 | } 102 | } 103 | 104 | // Build the WHERE clause for the primary keys. 105 | $where = $k.'='.implode(' OR '.$k.'=', $pks); 106 | 107 | // Determine if there is checkin support for the table. 108 | if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) { 109 | $checkin = ''; 110 | } 111 | else { 112 | $checkin = ' AND (checked_out = 0 OR checked_out = '.(int) $userId.')'; 113 | } 114 | 115 | // Update the publishing state for rows with the given primary keys. 116 | $this->_db->setQuery( 117 | 'UPDATE `'.$this->_tbl.'`' . 118 | ' SET `state` = '.(int) $state . 119 | ' WHERE ('.$where.')' . 120 | $checkin 121 | ); 122 | $this->_db->query(); 123 | 124 | // Check for a database error. 125 | if ($this->_db->getErrorNum()) { 126 | $this->setError($this->_db->getErrorMsg()); 127 | return false; 128 | } 129 | 130 | // If checkin is supported and all rows were adjusted, check them in. 131 | if ($checkin && (count($pks) == $this->_db->getAffectedRows())) 132 | { 133 | // Checkin the rows. 134 | foreach($pks as $pk) 135 | { 136 | $this->checkin($pk); 137 | } 138 | } 139 | 140 | // If the JTable instance value is in the list of primary keys that were set, set the instance. 141 | if (in_array($this->$k, $pks)) { 142 | $this->state = $state; 143 | } 144 | 145 | $this->setError(''); 146 | return true; 147 | } 148 | 149 | /** 150 | * Overloaded load function 151 | * 152 | * @param int $pk primary key 153 | * @param boolean $reset reset data 154 | * @return boolean 155 | * @see JTable:load 156 | */ 157 | public function load($pk = null, $reset = true) 158 | { 159 | if (parent::load($pk, $reset)) 160 | { 161 | // Convert the params field to a registry. 162 | /* 163 | $params = new JRegistry; 164 | $params->loadJSON($this->params); 165 | $this->params = $params; 166 | */ 167 | return true; 168 | } 169 | else 170 | { 171 | return false; 172 | } 173 | } 174 | 175 | 176 | } 177 | -------------------------------------------------------------------------------- /administrator/tables/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/tables/issue.php: -------------------------------------------------------------------------------- 1 | loadArray($array['params']); 44 | $array['params'] = (string)$registry; 45 | } 46 | 47 | if (isset($array['metadata']) && is_array($array['metadata'])) { 48 | $registry = new JRegistry(); 49 | $registry->loadArray($array['metadata']); 50 | $array['metadata'] = (string)$registry; 51 | } 52 | return parent::bind($array, $ignore); 53 | } 54 | 55 | /** 56 | * Overloaded check function 57 | */ 58 | public function check() { 59 | 60 | //If there is an ordering column and this is a new row then get the next ordering value 61 | if (property_exists($this, 'ordering') && $this->id == 0) { 62 | $this->ordering = self::getNextOrder(); 63 | } 64 | 65 | return parent::check(); 66 | } 67 | 68 | 69 | /** 70 | * Method to set the publishing state for a row or list of rows in the database 71 | * table. The method respects checked out rows by other users and will attempt 72 | * to checkin rows that it can after adjustments are made. 73 | * 74 | * @param mixed An optional array of primary key values to update. If not 75 | * set the instance property value is used. 76 | * @param integer The publishing state. eg. [0 = unpublished, 1 = published] 77 | * @param integer The user id of the user performing the operation. 78 | * @return boolean True on success. 79 | * @since 1.0.4 80 | */ 81 | public function publish($pks = null, $state = 1, $userId = 0) 82 | { 83 | // Initialise variables. 84 | $k = $this->_tbl_key; 85 | 86 | // Sanitize input. 87 | JArrayHelper::toInteger($pks); 88 | $userId = (int) $userId; 89 | $state = (int) $state; 90 | 91 | // If there are no primary keys set check to see if the instance key is set. 92 | if (empty($pks)) 93 | { 94 | if ($this->$k) { 95 | $pks = array($this->$k); 96 | } 97 | // Nothing to set publishing state on, return false. 98 | else { 99 | $this->setError(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED')); 100 | return false; 101 | } 102 | } 103 | 104 | // Build the WHERE clause for the primary keys. 105 | $where = $k.'='.implode(' OR '.$k.'=', $pks); 106 | 107 | // Determine if there is checkin support for the table. 108 | if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) { 109 | $checkin = ''; 110 | } 111 | else { 112 | $checkin = ' AND (checked_out = 0 OR checked_out = '.(int) $userId.')'; 113 | } 114 | 115 | // Update the publishing state for rows with the given primary keys. 116 | $this->_db->setQuery( 117 | 'UPDATE `'.$this->_tbl.'`' . 118 | ' SET `state` = '.(int) $state . 119 | ' WHERE ('.$where.')' . 120 | $checkin 121 | ); 122 | $this->_db->query(); 123 | 124 | // Check for a database error. 125 | if ($this->_db->getErrorNum()) { 126 | $this->setError($this->_db->getErrorMsg()); 127 | return false; 128 | } 129 | 130 | // If checkin is supported and all rows were adjusted, check them in. 131 | if ($checkin && (count($pks) == $this->_db->getAffectedRows())) 132 | { 133 | // Checkin the rows. 134 | foreach($pks as $pk) 135 | { 136 | $this->checkin($pk); 137 | } 138 | } 139 | 140 | // If the JTable instance value is in the list of primary keys that were set, set the instance. 141 | if (in_array($this->$k, $pks)) { 142 | $this->state = $state; 143 | } 144 | 145 | $this->setError(''); 146 | return true; 147 | } 148 | 149 | /** 150 | * Overloaded load function 151 | * 152 | * @param int $pk primary key 153 | * @param boolean $reset reset data 154 | * @return boolean 155 | * @see JTable:load 156 | */ 157 | public function load($pk = null, $reset = true) 158 | { 159 | if (parent::load($pk, $reset)) 160 | { 161 | // Convert the params field to a registry. 162 | $params = new JRegistry; 163 | 164 | $params->loadJSON($this->params); 165 | $this->params = $params; 166 | return true; 167 | } 168 | else 169 | { 170 | return false; 171 | } 172 | } 173 | 174 | 175 | } 176 | -------------------------------------------------------------------------------- /administrator/tables/key.php: -------------------------------------------------------------------------------- 1 | loadArray($array['params']); 44 | $array['params'] = (string)$registry; 45 | } 46 | 47 | if (isset($array['metadata']) && is_array($array['metadata'])) { 48 | $registry = new JRegistry(); 49 | $registry->loadArray($array['metadata']); 50 | $array['metadata'] = (string)$registry; 51 | } 52 | return parent::bind($array, $ignore); 53 | } 54 | 55 | /** 56 | * Overloaded check function 57 | */ 58 | public function check() { 59 | 60 | //If there is an ordering column and this is a new row then get the next ordering value 61 | if (property_exists($this, 'ordering') && $this->id == 0) { 62 | $this->ordering = self::getNextOrder(); 63 | } 64 | 65 | return parent::check(); 66 | } 67 | 68 | 69 | /** 70 | * Method to set the publishing state for a row or list of rows in the database 71 | * table. The method respects checked out rows by other users and will attempt 72 | * to checkin rows that it can after adjustments are made. 73 | * 74 | * @param mixed An optional array of primary key values to update. If not 75 | * set the instance property value is used. 76 | * @param integer The publishing state. eg. [0 = unpublished, 1 = published] 77 | * @param integer The user id of the user performing the operation. 78 | * @return boolean True on success. 79 | * @since 1.0.4 80 | */ 81 | public function publish($pks = null, $state = 1, $userId = 0) 82 | { 83 | // Initialise variables. 84 | $k = $this->_tbl_key; 85 | 86 | // Sanitize input. 87 | JArrayHelper::toInteger($pks); 88 | $userId = (int) $userId; 89 | $state = (int) $state; 90 | 91 | // If there are no primary keys set check to see if the instance key is set. 92 | if (empty($pks)) 93 | { 94 | if ($this->$k) { 95 | $pks = array($this->$k); 96 | } 97 | // Nothing to set publishing state on, return false. 98 | else { 99 | $this->setError(JText::_('JLIB_DATABASE_ERROR_NO_ROWS_SELECTED')); 100 | return false; 101 | } 102 | } 103 | 104 | // Build the WHERE clause for the primary keys. 105 | $where = $k.'='.implode(' OR '.$k.'=', $pks); 106 | 107 | // Determine if there is checkin support for the table. 108 | if (!property_exists($this, 'checked_out') || !property_exists($this, 'checked_out_time')) { 109 | $checkin = ''; 110 | } 111 | else { 112 | $checkin = ' AND (checked_out = 0 OR checked_out = '.(int) $userId.')'; 113 | } 114 | 115 | // Update the publishing state for rows with the given primary keys. 116 | $this->_db->setQuery( 117 | 'UPDATE `'.$this->_tbl.'`' . 118 | ' SET `state` = '.(int) $state . 119 | ' WHERE ('.$where.')' . 120 | $checkin 121 | ); 122 | $this->_db->query(); 123 | 124 | // Check for a database error. 125 | if ($this->_db->getErrorNum()) { 126 | $this->setError($this->_db->getErrorMsg()); 127 | return false; 128 | } 129 | 130 | // If checkin is supported and all rows were adjusted, check them in. 131 | if ($checkin && (count($pks) == $this->_db->getAffectedRows())) 132 | { 133 | // Checkin the rows. 134 | foreach($pks as $pk) 135 | { 136 | $this->checkin($pk); 137 | } 138 | } 139 | 140 | // If the JTable instance value is in the list of primary keys that were set, set the instance. 141 | if (in_array($this->$k, $pks)) { 142 | $this->state = $state; 143 | } 144 | 145 | $this->setError(''); 146 | return true; 147 | } 148 | 149 | /** 150 | * Overloaded load function 151 | * 152 | * @param int $pk primary key 153 | * @param boolean $reset reset data 154 | * @return boolean 155 | * @see JTable:load 156 | */ 157 | public function load($pk = null, $reset = true) 158 | { 159 | if (parent::load($pk, $reset)) 160 | { 161 | // Convert the params field to a registry. 162 | /* 163 | $params = new JRegistry; 164 | $params->loadJSON($this->params); 165 | $this->params = $params; 166 | */ 167 | return true; 168 | } 169 | else 170 | { 171 | return false; 172 | } 173 | } 174 | 175 | 176 | } 177 | -------------------------------------------------------------------------------- /administrator/views/comment/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/comment/tmpl/edit.php: -------------------------------------------------------------------------------- 1 | form->getFieldsets('params'); 16 | ?> 17 | 28 | 29 |
30 |
31 |
32 | 33 |
    34 | form->getFieldset('details') as $field): ?> 35 | 36 |
  • 37 | label; 39 | 40 | if ($field->type == 'Editor'){ 41 | echo '
    '.$field->input . '
    '; 42 | } 43 | 44 | else{ 45 | echo $field->input; 46 | } 47 | 48 | ?> 49 |
  • 50 | 51 |
52 |
53 |
54 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | -------------------------------------------------------------------------------- /administrator/views/comment/tmpl/edit_metadata.php: -------------------------------------------------------------------------------- 1 | 12 | 28 | -------------------------------------------------------------------------------- /administrator/views/comment/tmpl/edit_options.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 |
16 | 22 |
23 | 24 | form->getFieldsets('params'); 25 | 26 | foreach ($fieldSets as $name => $fieldSet) : 27 | $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_IMPROVEMYCITY_'.$name.'_FIELDSET_LABEL'; 28 | echo JHtml::_('sliders.panel',JText::_($label), $name.'-options'); 29 | if (isset($fieldSet->description) && trim($fieldSet->description)) : 30 | echo '

'.$this->escape(JText::_($fieldSet->description)).'

'; 31 | endif; 32 | ?> 33 |
34 | 46 | 47 |
48 | 49 | -------------------------------------------------------------------------------- /administrator/views/comment/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/comment/view.html.php: -------------------------------------------------------------------------------- 1 | state = $this->get('State'); 30 | $this->item = $this->get('Item'); 31 | $this->form = $this->get('Form'); 32 | 33 | // Check for errors. 34 | if (count($errors = $this->get('Errors'))) { 35 | JError::raiseError(500, implode("\n", $errors)); 36 | return false; 37 | } 38 | 39 | $this->addToolbar(); 40 | parent::display($tpl); 41 | 42 | } 43 | 44 | /** 45 | * Add the page title and toolbar. 46 | */ 47 | protected function addToolbar() 48 | { 49 | JRequest::setVar('hidemainmenu', true); 50 | 51 | $user = JFactory::getUser(); 52 | $isNew = ($this->item->id == 0); 53 | if (isset($this->item->checked_out)) { 54 | $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); 55 | } else { 56 | $checkedOut = false; 57 | } 58 | $canDo = ImprovemycityHelper::getActions(); 59 | 60 | JToolBarHelper::title(JText::_('COM_IMPROVEMYCITY_TITLE_COMMENT'), 'item.png'); 61 | 62 | // If not checked out, can save the item. 63 | if (!$checkedOut && ($canDo->get('core.edit')||($canDo->get('core.create')))) 64 | { 65 | 66 | JToolBarHelper::apply('comment.apply', 'JTOOLBAR_APPLY'); 67 | JToolBarHelper::save('comment.save', 'JTOOLBAR_SAVE'); 68 | } 69 | /* 70 | if (!$checkedOut && ($canDo->get('core.create'))){ 71 | JToolBarHelper::custom('comment.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); 72 | } 73 | */ 74 | // If an existing item, can save to a copy. 75 | /* 76 | if (!$isNew && $canDo->get('core.create')) { 77 | JToolBarHelper::custom('issue.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); 78 | } 79 | */ 80 | if (empty($this->item->id)) { 81 | JToolBarHelper::cancel('comment.cancel', 'JTOOLBAR_CANCEL'); 82 | } 83 | else { 84 | JToolBarHelper::cancel('comment.cancel', 'JTOOLBAR_CLOSE'); 85 | } 86 | 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /administrator/views/comments/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/comments/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/comments/view.html.php: -------------------------------------------------------------------------------- 1 | state = $this->get('State'); 30 | $this->items = $this->get('Items'); 31 | $this->pagination = $this->get('Pagination'); 32 | 33 | // Check for errors. 34 | if (count($errors = $this->get('Errors'))) { 35 | JError::raiseError(500, implode("\n", $errors)); 36 | return false; 37 | } 38 | 39 | $this->addToolbar(); 40 | parent::display($tpl); 41 | } 42 | 43 | /** 44 | * Add the page title and toolbar. 45 | * 46 | * @since 1.6 47 | */ 48 | protected function addToolbar() 49 | { 50 | require_once JPATH_COMPONENT.DS.'helpers'.DS.'improvemycity.php'; 51 | 52 | $state = $this->get('State'); 53 | $canDo = ImprovemycityHelper::getActions($state->get('filter.improvemycityid')); 54 | 55 | JToolBarHelper::title(JText::_('COM_IMPROVEMYCITY_TITLE_COMMENTS'), 'items.png'); 56 | 57 | //Check if the form exists before showing the add/edit buttons 58 | $formPath = JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'comment'; 59 | if (file_exists($formPath)) { 60 | 61 | if ($canDo->get('core.create')) { 62 | JToolBarHelper::addNew('comment.add','JTOOLBAR_NEW'); 63 | } 64 | 65 | if ($canDo->get('core.edit')) { 66 | JToolBarHelper::editList('comment.edit','JTOOLBAR_EDIT'); 67 | } 68 | 69 | } 70 | 71 | if ($canDo->get('core.edit.state')) { 72 | 73 | if (isset($this->items[0]->state)) { 74 | JToolBarHelper::divider(); 75 | JToolBarHelper::custom('comments.publish', 'publish.png', 'publish_f2.png','JTOOLBAR_PUBLISH', true); 76 | JToolBarHelper::custom('comments.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); 77 | } else { 78 | //If this component does not use state then show a direct delete button as we can not trash 79 | JToolBarHelper::deleteList('', 'comments.delete','JTOOLBAR_DELETE'); 80 | } 81 | 82 | if (isset($this->items[0]->state)) { 83 | JToolBarHelper::divider(); 84 | JToolBarHelper::archiveList('comments.archive','JTOOLBAR_ARCHIVE'); 85 | } 86 | if (isset($this->items[0]->checked_out)) { 87 | JToolBarHelper::custom('comments.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); 88 | } 89 | } 90 | 91 | //Show trash and delete for components that uses the state field 92 | if (isset($this->items[0]->state)) { 93 | if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { 94 | JToolBarHelper::deleteList('', 'comments.delete','JTOOLBAR_EMPTY_TRASH'); 95 | JToolBarHelper::divider(); 96 | } else if ($canDo->get('core.edit.state')) { 97 | JToolBarHelper::trash('comments.trash','JTOOLBAR_TRASH'); 98 | JToolBarHelper::divider(); 99 | } 100 | } 101 | 102 | if ($canDo->get('core.admin')) { 103 | JToolBarHelper::preferences('com_improvemycity'); 104 | } 105 | 106 | 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /administrator/views/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /administrator/views/issue/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/issue/tmpl/edit.php: -------------------------------------------------------------------------------- 1 | form->getFieldsets('params'); 16 | ?> 17 | 28 | 29 |
30 |
31 |
32 | 33 |
    34 | form->getFieldset('details') as $field): ?> 35 | 36 |
  • 37 | label; 39 | 40 | if ($field->type == 'Editor'){ 41 | echo '
    '.$field->input . '
    '; 42 | } 43 | else if ($field->type == 'Media'){ 44 | echo $field->input; 45 | echo ''.JText::_('COM_IMPROVEMYCITY_PHOTO_PREVIEW').''; 46 | } 47 | else{ 48 | echo $field->input; 49 | } 50 | 51 | ?> 52 |
  • 53 | 54 |
  • issuer->username; ?>
  • 55 |
  • issuer->name; ?>
  • 56 |
  • issuer->email; ?>
  • 57 | 58 | 59 |
60 |
61 |
62 | 63 |
64 | 65 | 66 |
67 |
68 | 69 |
70 | 71 |
72 |
73 | 74 | 75 |
76 |
77 | 78 | $fieldset): ?> 79 | label), $name.'-params');?> 80 | description) && trim($fieldset->description)): ?> 81 |

escape(JText::_($fieldset->description));?>

82 | 83 |
84 |
    85 | form->getFieldset($name) as $field) : ?> 86 |
  • label; ?>input; ?>
  • 87 | 88 |
89 |
90 | 91 | 92 | 93 | 94 |
95 |
96 | 97 | 98 | 99 |
100 |
101 | -------------------------------------------------------------------------------- /administrator/views/issue/tmpl/edit_metadata.php: -------------------------------------------------------------------------------- 1 | 12 | 28 | -------------------------------------------------------------------------------- /administrator/views/issue/tmpl/edit_options.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 |
16 | 22 |
23 | 24 | form->getFieldsets('params'); 25 | 26 | foreach ($fieldSets as $name => $fieldSet) : 27 | $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_IMPROVEMYCITY_'.$name.'_FIELDSET_LABEL'; 28 | echo JHtml::_('sliders.panel',JText::_($label), $name.'-options'); 29 | if (isset($fieldSet->description) && trim($fieldSet->description)) : 30 | echo '

'.$this->escape(JText::_($fieldSet->description)).'

'; 31 | endif; 32 | ?> 33 |
34 | 46 | 47 |
48 | 49 | -------------------------------------------------------------------------------- /administrator/views/issue/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/issues/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/issues/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/issues/view.html.php: -------------------------------------------------------------------------------- 1 | state = $this->get('State'); 30 | $this->items = $this->get('Items'); 31 | $this->pagination = $this->get('Pagination'); 32 | 33 | // Check for errors. 34 | if (count($errors = $this->get('Errors'))) { 35 | JError::raiseError(500, implode("\n", $errors)); 36 | return false; 37 | } 38 | 39 | $this->addToolbar(); 40 | parent::display($tpl); 41 | } 42 | 43 | /** 44 | * Add the page title and toolbar. 45 | * 46 | * @since 1.6 47 | */ 48 | protected function addToolbar() 49 | { 50 | require_once JPATH_COMPONENT.DS.'helpers'.DS.'improvemycity.php'; 51 | 52 | $state = $this->get('State'); 53 | $canDo = ImprovemycityHelper::getActions($state->get('filter.category_id')); 54 | 55 | JToolBarHelper::title(JText::_('COM_IMPROVEMYCITY_TITLE_ITEMS'), 'items.png'); 56 | 57 | //Check if the form exists before showing the add/edit buttons 58 | $formPath = JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'issue'; 59 | if (file_exists($formPath)) { 60 | 61 | if ($canDo->get('core.create')) { 62 | JToolBarHelper::addNew('issue.add','JTOOLBAR_NEW'); 63 | } 64 | 65 | if ($canDo->get('core.edit')) { 66 | JToolBarHelper::editList('issue.edit','JTOOLBAR_EDIT'); 67 | } 68 | 69 | } 70 | 71 | if ($canDo->get('core.edit.state')) { 72 | 73 | if (isset($this->items[0]->state)) { 74 | JToolBarHelper::divider(); 75 | JToolBarHelper::custom('issues.publish', 'publish.png', 'publish_f2.png','JTOOLBAR_PUBLISH', true); 76 | JToolBarHelper::custom('issues.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); 77 | } else { 78 | //If this component does not use state then show a direct delete button as we can not trash 79 | JToolBarHelper::deleteList('', 'issues.delete','JTOOLBAR_DELETE'); 80 | } 81 | 82 | if (isset($this->items[0]->state)) { 83 | JToolBarHelper::divider(); 84 | JToolBarHelper::archiveList('issues.archive','JTOOLBAR_ARCHIVE'); 85 | } 86 | if (isset($this->items[0]->checked_out)) { 87 | JToolBarHelper::custom('issues.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); 88 | } 89 | } 90 | 91 | //Show trash and delete for components that uses the state field 92 | if (isset($this->items[0]->state)) { 93 | if ($state->get('filter.published') == -2 && $canDo->get('core.delete')) { 94 | JToolBarHelper::deleteList('', 'issues.delete','JTOOLBAR_EMPTY_TRASH'); 95 | JToolBarHelper::divider(); 96 | } else if ($canDo->get('core.edit.state')) { 97 | JToolBarHelper::trash('issues.trash','JTOOLBAR_TRASH'); 98 | JToolBarHelper::divider(); 99 | } 100 | } 101 | 102 | if ($canDo->get('core.admin')) { 103 | JToolBarHelper::preferences('com_improvemycity'); 104 | } 105 | 106 | 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /administrator/views/key/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/key/tmpl/edit.php: -------------------------------------------------------------------------------- 1 | form->getFieldsets('params'); 16 | ?> 17 | 28 | 29 |
30 |
31 |
32 | 33 |
    34 | form->getFieldset('details') as $field): ?> 35 | 36 |
  • 37 | label; 39 | 40 | if ($field->type == 'Editor'){ 41 | echo '
    '.$field->input . '
    '; 42 | } 43 | 44 | else{ 45 | echo $field->input; 46 | } 47 | 48 | ?> 49 |
  • 50 | 51 |
52 |
53 |
54 | 55 |
56 | 57 | 58 | 59 |
60 |
61 | -------------------------------------------------------------------------------- /administrator/views/key/tmpl/edit_metadata.php: -------------------------------------------------------------------------------- 1 | 12 | 28 | -------------------------------------------------------------------------------- /administrator/views/key/tmpl/edit_options.php: -------------------------------------------------------------------------------- 1 | 12 | 13 | 14 | 15 |
16 | 22 |
23 | 24 | form->getFieldsets('params'); 25 | 26 | foreach ($fieldSets as $name => $fieldSet) : 27 | $label = !empty($fieldSet->label) ? $fieldSet->label : 'COM_IMPROVEMYCITY_'.$name.'_FIELDSET_LABEL'; 28 | echo JHtml::_('sliders.panel',JText::_($label), $name.'-options'); 29 | if (isset($fieldSet->description) && trim($fieldSet->description)) : 30 | echo '

'.$this->escape(JText::_($fieldSet->description)).'

'; 31 | endif; 32 | ?> 33 |
34 | 46 | 47 |
48 | 49 | -------------------------------------------------------------------------------- /administrator/views/key/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/key/view.html.php: -------------------------------------------------------------------------------- 1 | state = $this->get('State'); 30 | $this->item = $this->get('Item'); 31 | $this->form = $this->get('Form'); 32 | 33 | // Check for errors. 34 | if (count($errors = $this->get('Errors'))) { 35 | JError::raiseError(500, implode("\n", $errors)); 36 | return false; 37 | } 38 | 39 | $this->addToolbar(); 40 | parent::display($tpl); 41 | 42 | } 43 | 44 | /** 45 | * Add the page title and toolbar. 46 | */ 47 | protected function addToolbar() 48 | { 49 | JRequest::setVar('hidemainmenu', true); 50 | 51 | $user = JFactory::getUser(); 52 | $isNew = ($this->item->id == 0); 53 | if (isset($this->item->checked_out)) { 54 | $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id')); 55 | } else { 56 | $checkedOut = false; 57 | } 58 | $canDo = ImprovemycityHelper::getActions(); 59 | 60 | JToolBarHelper::title(JText::_('COM_IMPROVEMYCITY_TITLE_KEY'), 'item.png'); 61 | 62 | // If not checked out, can save the item. 63 | if (!$checkedOut && ($canDo->get('core.edit')||($canDo->get('core.create')))) 64 | { 65 | 66 | JToolBarHelper::apply('key.apply', 'JTOOLBAR_APPLY'); 67 | JToolBarHelper::save('key.save', 'JTOOLBAR_SAVE'); 68 | } 69 | /* 70 | if (!$checkedOut && ($canDo->get('core.create'))){ 71 | JToolBarHelper::custom('comment.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false); 72 | } 73 | */ 74 | // If an existing item, can save to a copy. 75 | /* 76 | if (!$isNew && $canDo->get('core.create')) { 77 | JToolBarHelper::custom('issue.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false); 78 | } 79 | */ 80 | if (empty($this->item->id)) { 81 | JToolBarHelper::cancel('key.cancel', 'JTOOLBAR_CANCEL'); 82 | } 83 | else { 84 | JToolBarHelper::cancel('key.cancel', 'JTOOLBAR_CLOSE'); 85 | } 86 | 87 | } 88 | 89 | 90 | } 91 | -------------------------------------------------------------------------------- /administrator/views/keys/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/keys/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/keys/view.html.php: -------------------------------------------------------------------------------- 1 | state = $this->get('State'); 30 | $this->items = $this->get('Items'); 31 | $this->pagination = $this->get('Pagination'); 32 | 33 | // Check for errors. 34 | if (count($errors = $this->get('Errors'))) { 35 | JError::raiseError(500, implode("\n", $errors)); 36 | return false; 37 | } 38 | 39 | $this->addToolbar(); 40 | parent::display($tpl); 41 | } 42 | 43 | /** 44 | * Add the page title and toolbar. 45 | * 46 | * @since 1.6 47 | */ 48 | protected function addToolbar() 49 | { 50 | require_once JPATH_COMPONENT.DS.'helpers'.DS.'improvemycity.php'; 51 | 52 | $state = $this->get('State'); 53 | $canDo = ImprovemycityHelper::getActions($state->get('filter.improvemycityid')); 54 | 55 | JToolBarHelper::title(JText::_('COM_IMPROVEMYCITY_TITLE_KEYS'), 'items.png'); 56 | 57 | //Check if the form exists before showing the add/edit buttons 58 | $formPath = JPATH_COMPONENT_ADMINISTRATOR.DS.'views'.DS.'key'; 59 | if (file_exists($formPath)) { 60 | 61 | if ($canDo->get('core.create')) { 62 | //DO NOT ALLOW MORE THAN KEYS 63 | //JToolBarHelper::addNew('key.add','JTOOLBAR_NEW'); 64 | } 65 | 66 | if ($canDo->get('core.edit')) { 67 | JToolBarHelper::editList('key.edit','JTOOLBAR_EDIT'); 68 | } 69 | 70 | } 71 | 72 | if ($canDo->get('core.edit.state')) { 73 | 74 | if (isset($this->items[0]->state)) { 75 | JToolBarHelper::divider(); 76 | //JToolBarHelper::custom('keys.publish', 'publish.png', 'publish_f2.png','JTOOLBAR_PUBLISH', true); 77 | //JToolBarHelper::custom('keys.unpublish', 'unpublish.png', 'unpublish_f2.png', 'JTOOLBAR_UNPUBLISH', true); 78 | } else { 79 | //If this component does not use state then show a direct delete button as we can not trash 80 | //JToolBarHelper::deleteList('', 'keys.delete','JTOOLBAR_DELETE'); 81 | } 82 | 83 | if (isset($this->items[0]->state)) { 84 | //JToolBarHelper::divider(); 85 | //JToolBarHelper::archiveList('keys.archive','JTOOLBAR_ARCHIVE'); 86 | } 87 | if (isset($this->items[0]->checked_out)) { 88 | JToolBarHelper::custom('keys.checkin', 'checkin.png', 'checkin_f2.png', 'JTOOLBAR_CHECKIN', true); 89 | } 90 | } 91 | 92 | //Show trash and delete for components that uses the state field 93 | if (isset($this->items[0]->state)) { 94 | if ($state->get('filter.state') == -2 && $canDo->get('core.delete')) { 95 | //JToolBarHelper::deleteList('', 'keys.delete','JTOOLBAR_EMPTY_TRASH'); 96 | //JToolBarHelper::divider(); 97 | } else if ($canDo->get('core.edit.state')) { 98 | //JToolBarHelper::trash('keys.trash','JTOOLBAR_TRASH'); 99 | //JToolBarHelper::divider(); 100 | } 101 | } 102 | 103 | if ($canDo->get('core.admin')) { 104 | JToolBarHelper::preferences('com_improvemycity'); 105 | } 106 | 107 | 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /administrator/views/reports/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/reports/tmpl/default.php: -------------------------------------------------------------------------------- 1 | state->get('list.ordering'); 16 | $listDirn = $this->state->get('list.direction'); 17 | $saveOrder = $listOrder == 'a.ordering'; 18 | ?> 19 | 20 | 21 |
22 |
23 | 32 |
33 | 34 | 40 | 41 | 45 | 46 |
47 |
48 |
49 |

50 | : statistics['open'] ;?>
51 | : statistics['ack'] ;?>
52 | : statistics['closed'] ;?>
53 | ------------------------------
54 | : statistics['closed']+$this->statistics['ack']+$this->statistics['open'] ;?>
55 |

56 |
57 |
58 |
59 | items)) {echo ''.JText::_('COM_IMPROVEMYCITY_NO_ISSUES_YET').''; }?> 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | items as $item){ 82 | $i++;$a = $i%2; 83 | echo ''; 84 | echo '' . "\n"; 85 | echo '' . "\n"; 86 | echo '' . "\n"; 87 | echo '' . "\n"; 88 | echo '' . "\n"; 89 | echo '' . "\n"; 90 | switch ($item->currentstatus){ 91 | case 1: 92 | echo '' . "\n"; 93 | break; 94 | case 2: 95 | echo '' . "\n"; 96 | break; 97 | case 3: 98 | echo '' . "\n"; 99 | break; 100 | } 101 | echo '' . "\n"; 102 | echo '' . "\n"; 103 | echo '' . "\n"; 104 | echo '' . "\n"; 105 | $issuer = &JFactory::getUser($item->userid); 106 | $userProfile = JUserHelper::getProfile( $item->userid ); 107 | $issuer->address = $userProfile->profile['address1']; 108 | $issuer->phone = $userProfile->profile['phone']; 109 | echo '' . "\n"; 110 | echo ''; 111 | 112 | } 113 | ?> 114 | 115 | 116 | 117 | 118 |
'.$item->id . ''.$item->title . ''.$item->category . ''.$item->latitude . ''.$item->longitude . ''.$item->address . ''.JText::_('JOPTION_SELECT_STATUS_OPEN').''.JText::_('JOPTION_SELECT_STATUS_ACK').''.JText::_('JOPTION_SELECT_STATUS_CLOSED').''.$item->reported . ''.$item->acknowledged . ''.$item->closed . ''.$item->username . ''.$issuer->email . '
'. $issuer->address . '
'. $issuer->phone . '
pagination->getListFooter(); ?>
119 | 120 |
121 | 122 | 123 | 124 | 125 | 126 |
127 |
-------------------------------------------------------------------------------- /administrator/views/reports/tmpl/default_print.php: -------------------------------------------------------------------------------- 1 | 16 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | items as $item){ 42 | $i++;$a = $i%2; 43 | echo ''; 44 | echo '' . "\n"; 45 | echo '' . "\n"; 46 | echo '' . "\n"; 47 | echo '' . "\n"; 48 | switch ($item->currentstatus){ 49 | case 1: 50 | echo '' . "\n"; 51 | break; 52 | case 2: 53 | echo '' . "\n"; 54 | break; 55 | case 3: 56 | echo '' . "\n"; 57 | break; 58 | } 59 | echo '' . "\n"; 60 | echo '' . "\n"; 61 | echo '' . "\n"; 62 | echo '' . "\n"; 63 | 64 | echo ''; 65 | 66 | } 67 | ?> 68 | 69 | 70 |
#
'.$item->id . ''.$item->title . ''.$item->category . ''.$item->address . ''.JText::_('JOPTION_SELECT_STATUS_OPEN').''.JText::_('JOPTION_SELECT_STATUS_ACK').''.JText::_('JOPTION_SELECT_STATUS_CLOSED').''.$item->reported . ''.$item->acknowledged . ''.$item->closed . ''.$item->username . '
71 | 72 | 73 | -------------------------------------------------------------------------------- /administrator/views/reports/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /administrator/views/reports/view.html.php: -------------------------------------------------------------------------------- 1 | state = $this->get('State'); 31 | $this->items = $this->get('Items'); 32 | $this->statistics = $this->get('Statistics'); 33 | $this->pagination = $this->get('Pagination'); 34 | 35 | $canDo = ImprovemycityHelper::getActions(); 36 | // Check for errors. 37 | if (count($errors = $this->get('Errors'))) { 38 | JError::raiseError(500, implode("\n", $errors)); 39 | return false; 40 | } 41 | 42 | $this->addToolbar(); 43 | parent::display($tpl); 44 | } 45 | 46 | /** 47 | * Add the page title and toolbar. 48 | */ 49 | protected function addToolbar() 50 | { 51 | require_once JPATH_COMPONENT.DS.'helpers'.DS.'improvemycity.php'; 52 | JToolBarHelper::title(JText::_('COM_IMPROVEMYCITY_REPORT'), 'items.png'); 53 | JToolBarHelper::back('JTOOLBAR_BACK', 'index.php?option=com_improvemycity'); 54 | } 55 | 56 | 57 | } 58 | -------------------------------------------------------------------------------- /administrator/views/reports/view.print.php: -------------------------------------------------------------------------------- 1 | state = $this->get('State'); 32 | $this->items = $this->get('Items'); 33 | $this->statistics = $this->get('Statistics'); 34 | $this->pagination = $this->get('Pagination'); 35 | 36 | $canDo = ImprovemycityHelper::getActions(); 37 | // Check for errors. 38 | if (count($errors = $this->get('Errors'))) { 39 | JError::raiseError(500, implode("\n", $errors)); 40 | return false; 41 | } 42 | 43 | $this->addToolbar(); 44 | parent::display('print'); 45 | } 46 | 47 | /** 48 | * Add the page title and toolbar. 49 | */ 50 | protected function addToolbar() 51 | { 52 | require_once JPATH_COMPONENT.DS.'helpers'.DS.'improvemycity.php'; 53 | JToolBarHelper::title(JText::_('COM_IMPROVEMYCITY_REPORT'), 'items.png'); 54 | JToolBarHelper::back('JTOOLBAR_BACK', 'index.php?option=com_improvemycity'); 55 | } 56 | 57 | 58 | } 59 | -------------------------------------------------------------------------------- /improvemycity.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | com_improvemycity 4 | 08 Dec 2014 5 | Copyright (C) 2011 - 2014 URENIO Research Unit. All rights reserved. 6 | GNU Affero General Public License version 3 or later; see LICENSE.txt 7 | Ioannis Tsampoulatidis for the URENIO Researh Unit 8 | info@urenio.org 9 | http://www.improve-my-city.com/ 10 | 2.6.0 11 | ImproveMyCity - Report, vote and track non-emergency issues. ImproveMyCity was developed within the European project "PEOPLE: Pilot smart urban Ecosystems leveraging Open innovation for Promoting and enabLing future E- services" which is co-financed by the European Commission (THEME [CIP-ICT-PSP.2010.4.1]). 12 | script.php 13 | 14 | 15 | sql/install.mysql.utf8.sql 16 | 17 | 18 | 19 | 20 | sql/uninstall.mysql.utf8.sql 21 | 22 | 23 | 24 | 25 | sql/updates/mysql 26 | 27 | 28 | 29 | index.html 30 | improvemycity.php 31 | controller.php 32 | router.php 33 | bootstrap 34 | views 35 | models 36 | controllers 37 | helpers 38 | js 39 | images 40 | css 41 | 42 | 43 | language/en-GB.com_improvemycity.ini 44 | language/el-GR.com_improvemycity.ini 45 | 46 | 47 | 48 | index.html 49 | images 50 | 51 | 52 | 53 | COM_IMPROVEMYCITY 54 | 55 | COM_IMPROVEMYCITY_ITEMS 56 | COM_IMPROVEMYCITY_CATEGORIES 57 | COM_IMPROVEMYCITY_COMMENTS 58 | COM_IMPROVEMYCITY_REPORTS 59 | COM_IMPROVEMYCITY_KEYS 60 | 61 | 62 | access.xml 63 | config.xml 64 | controller.php 65 | index.html 66 | improvemycity.php 67 | controllers 68 | helpers 69 | models 70 | sql 71 | tables 72 | views 73 | 74 | 75 | language/en-GB.com_improvemycity.ini 76 | language/en-GB.com_improvemycity.sys.ini 77 | language/el-GR.com_improvemycity.ini 78 | language/el-GR.com_improvemycity.sys.ini 79 | 80 | 81 | 82 | http://www.improve-my-city.com/autoupdates-repo/improvemycity-update.xml 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /media/images/improvemycity-128x128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/media/images/improvemycity-128x128.png -------------------------------------------------------------------------------- /media/images/improvemycity-16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/media/images/improvemycity-16x16.png -------------------------------------------------------------------------------- /media/images/improvemycity-24x24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/media/images/improvemycity-24x24.png -------------------------------------------------------------------------------- /media/images/improvemycity-256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/media/images/improvemycity-256x256.png -------------------------------------------------------------------------------- /media/images/improvemycity-32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/media/images/improvemycity-32x32.png -------------------------------------------------------------------------------- /media/images/improvemycity-48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/media/images/improvemycity-48x48.png -------------------------------------------------------------------------------- /media/images/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /media/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/bootstrap/css/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/bootstrap/img/glyphicons-halflings-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/bootstrap/img/glyphicons-halflings-white.png -------------------------------------------------------------------------------- /site/bootstrap/img/glyphicons-halflings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/bootstrap/img/glyphicons-halflings.png -------------------------------------------------------------------------------- /site/bootstrap/img/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/bootstrap/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/bootstrap/js/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/controller.php: -------------------------------------------------------------------------------- 1 | getView($view, 'html'); 24 | $v->setModel($this->getModel($view), true); //the default model (true) :: $view is either issues or issue 25 | $v->setModel($this->getModel('discussions')); 26 | $v->display(); 27 | 28 | return $this; 29 | } 30 | 31 | function addIssue() 32 | { 33 | $view = JRequest::getCmd('view', 'addissue'); 34 | JRequest::setVar('view', $view); 35 | 36 | 37 | $v = & $this->getView($view, 'html'); 38 | $v->setModel($this->getModel($view)); 39 | //$v->display(); 40 | parent::display(); 41 | 42 | return $this; 43 | } 44 | 45 | 46 | /** 47 | * only called async from ajax 48 | * function returns a list of all comments for the specific issueid or false if fail 49 | */ 50 | function addComment() 51 | { 52 | /* TODO: Admins must have different avatar */ 53 | /* $user =& JFactory::getUser(); print_r($user); http://forum.joomla.org/viewtopic.php?p=2730458 */ 54 | JRequest::checkToken('post') or jexit('Invalid Token'); 55 | 56 | $user =& JFactory::getUser(); 57 | 58 | if(!$user->guest) 59 | { 60 | /* FOR DEBUGGING ONLY 61 | ob_start(); 62 | echo ( JRequest::getVar('description', '', 'post', STRING, JREQUEST_ALLOWHTML) ); 63 | $var = ob_get_contents(); 64 | ob_end_clean(); 65 | $fp=fopen('zlog.txt','w'); 66 | fputs($fp,$var); 67 | fclose($fp); 68 | */ 69 | 70 | //update comments 71 | $model = $this->getModel('discussions'); 72 | //$descr = JRequest::getVar('description', '', 'post'); 73 | $descr = $_POST['description']; 74 | $comments = $model->comment(JRequest::getVar('issue_id'), $user->id, $descr); 75 | 76 | if($comments == false){ 77 | $ret['msg'] = JText::_('COMMENT_ERROR'); 78 | echo json_encode($ret); 79 | return; 80 | } 81 | 82 | //notify admin by email 83 | $mail = $model->commentNotificationMail(JRequest::getVar('issue_id'), $user->id, $descr); 84 | if ($mail == false ){ 85 | 86 | /* ob_start(); 87 | echo 'mail failed'; 88 | $var = ob_get_contents(); 89 | ob_end_clean(); 90 | $fp=fopen('zlog.txt','w'); 91 | fputs($fp,$var); 92 | fclose($fp); 93 | */ 94 | $ret['msg'] = JText::_('Comment sent but no notification mail sent to administrator (Please refresh by pressing F5'); 95 | echo json_encode($ret); 96 | return; 97 | } 98 | 99 | 100 | $ret['msg'] = JText::_('COMMENT_ADDED'); 101 | //$ret['comments'] = json_encode($comments); 102 | $ret['comments'] = $comments; 103 | header("Content-Type: application/xhtml+xml; charset=utf-8"); 104 | echo json_encode($ret); 105 | 106 | 107 | return; 108 | } 109 | else { 110 | //$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); 111 | $ret['msg'] = JText::_('ONLY_LOGGED_COMMENT'); 112 | header("Content-Type: application/xhtml+xml; charset=utf-8"); 113 | echo json_encode($ret); 114 | 115 | } 116 | } 117 | 118 | /** 119 | * only called async from ajax 120 | * function returns vote counter or -1 if fail 121 | */ 122 | function addVote() 123 | { 124 | JRequest::checkToken('get') or jexit('Invalid Token'); 125 | 126 | $user =& JFactory::getUser(); 127 | if(!$user->guest) 128 | { 129 | //update vote 130 | $model = $this->getModel('issue'); 131 | if($model->getHasVoted() == 0){ 132 | $votes = $model->vote(); 133 | if($votes == -1){ 134 | $ret['msg'] = JText::_('VOTE_ERROR'); 135 | echo json_encode($ret); 136 | } 137 | 138 | $ret['msg'] = JText::_('VOTE_ADDED'); 139 | $ret['votes'] = $votes; 140 | echo json_encode($ret); 141 | } 142 | else{ 143 | $ret['msg'] = JText::_('ALREADY_VOTED'); 144 | echo json_encode($ret); 145 | } 146 | } 147 | else { 148 | //$this->setRedirect(JRoute::_('index.php?option=com_users&view=login', false)); 149 | $ret['msg'] = JText::_('ONLY_LOGGED_VOTE'); 150 | echo json_encode($ret); 151 | } 152 | //return 0; 153 | } 154 | 155 | function smartLogin() 156 | { 157 | $view = JRequest::getCmd('view', 'smartLogin'); 158 | JRequest::setVar('view', $view); 159 | 160 | $v = & $this->getView($view, 'html'); 161 | ///$v->setModel($this->getModel($view)); //$view=addissue 162 | //$v->display(); 163 | parent::display(); 164 | 165 | return $this; 166 | } 167 | 168 | /** 169 | * only called async from ajax as format=raw from ajax 170 | */ 171 | function getMarkersAsXML() 172 | { 173 | JRequest::checkToken('get') or jexit('Invalid Token'); 174 | $v = & $this->getView('issues', 'raw'); 175 | $v->setModel($this->getModel('issues'), true); 176 | $v->display(); 177 | } 178 | 179 | /** 180 | * only called async from ajax as format=raw from ajax 181 | */ 182 | function getMarkerAsXML() 183 | { 184 | //JRequest::checkToken() or jexit('Invalid Token'); //for write 185 | JRequest::checkToken('get') or jexit('Invalid Token'); //for read 186 | 187 | $v = & $this->getView('issue', 'raw'); 188 | $v->setModel($this->getModel('issue'), true); 189 | $v->display(); 190 | } 191 | 192 | 193 | function printIssue() 194 | { 195 | $v = & $this->getView('issue', 'print'); //view.print.php 196 | $v->setModel($this->getModel('issue'), true); //load issue model 197 | $v->setModel($this->getModel('discussions')); //load comments as well 198 | $v->display('print'); //template set to tmpl/default_print.php 199 | 200 | } 201 | 202 | /* 203 | model loads and inside view.print.php all issues without paging 204 | are loaded. 205 | */ 206 | function printIssues() 207 | { 208 | $v = & $this->getView('issues', 'print'); //view.print.php 209 | $v->setModel($this->getModel('issues'), true); //load issues model 210 | $v->display('print'); //template set to tmpl/default_print.php 211 | } 212 | 213 | 214 | } 215 | -------------------------------------------------------------------------------- /site/controllers/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/controllers/issue.php: -------------------------------------------------------------------------------- 1 | setRedirect($this->getReturnPage()); 25 | } 26 | 27 | 28 | /** 29 | * Get the return URL. 30 | * 31 | * If a "return" variable has been passed in the request 32 | * 33 | * @return string The return URL. 34 | */ 35 | protected function getReturnPage() 36 | { 37 | $return = JRequest::getVar('return', null, 'default', 'base64'); 38 | 39 | if (empty($return) || !JUri::isInternal(base64_decode($return))) { 40 | return JURI::base(); 41 | } 42 | else { 43 | return base64_decode($return); 44 | } 45 | } 46 | 47 | public function getModel($name = 'addissue', $prefix = '', $config = array('ignore_request' => true)) 48 | { 49 | $model = parent::getModel($name, $prefix, $config); 50 | 51 | return $model; 52 | } 53 | 54 | 55 | //TODO: maybe to put this on a model instead ? 56 | /** 57 | * Send Email. 58 | * taken from \components\com_contact\controllers\contact.php 59 | * If a "return" variable has been passed in the request 60 | * 61 | * @return boolen True if successfully send. 62 | */ 63 | private function _sendEmail($data, $contact) 64 | { 65 | $app = JFactory::getApplication(); 66 | $params = JComponentHelper::getParams('com_contact'); 67 | if ($contact->email_to == '' && $contact->user_id != 0) { 68 | $contact_user = JUser::getInstance($contact->user_id); 69 | $contact->email_to = $contact_user->get('email'); 70 | } 71 | $mailfrom = $app->getCfg('mailfrom'); 72 | $fromname = $app->getCfg('fromname'); 73 | $sitename = $app->getCfg('sitename'); 74 | $copytext = JText::sprintf('COM_CONTACT_COPYTEXT_OF', $contact->name, $sitename); 75 | 76 | $name = $data['contact_name']; 77 | $email = $data['contact_email']; 78 | $subject = $data['contact_subject']; 79 | $body = $data['contact_message']; 80 | 81 | // Prepare email body 82 | $prefix = JText::sprintf('COM_CONTACT_ENQUIRY_TEXT', JURI::base()); 83 | $body = $prefix."\n".$name.' <'.$email.'>'."\r\n\r\n".stripslashes($body); 84 | 85 | $mail = JFactory::getMailer(); 86 | $mail->addRecipient($contact->email_to); 87 | $mail->addReplyTo(array($email, $name)); 88 | $mail->setSender(array($mailfrom, $fromname)); 89 | $mail->setSubject($sitename.': '.$subject); 90 | $mail->setBody($body); 91 | $sent = $mail->Send(); 92 | 93 | //If we are supposed to copy the sender, do so. 94 | 95 | // check whether email copy function activated 96 | if ( array_key_exists('contact_email_copy',$data) ) { 97 | $copytext = JText::sprintf('COM_CONTACT_COPYTEXT_OF', $contact->name, $sitename); 98 | $copytext .= "\r\n\r\n".$body; 99 | $copysubject = JText::sprintf('COM_CONTACT_COPYSUBJECT_OF', $subject); 100 | 101 | $mail = JFactory::getMailer(); 102 | $mail->addRecipient($email); 103 | $mail->addReplyTo(array($email, $name)); 104 | $mail->setSender(array($mailfrom, $fromname)); 105 | $mail->setSubject($copysubject); 106 | $mail->setBody($copytext); 107 | $sent = $mail->Send(); 108 | } 109 | 110 | return $sent; 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /site/controllers/issues.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/css/mega-menu.css: -------------------------------------------------------------------------------- 1 | /* 2 | Based on http://net.tutsplus.com/tutorials/html-css-techniques/how-to-build-a-kick-butt-css3-mega-drop-down-menu/ 3 | */ 4 | #mega-menu { margin: 0; padding: 0;} 5 | #mega-menu li { 6 | float:left; 7 | display:block; 8 | text-align:center; 9 | position:relative; 10 | padding-top: 5px; 11 | margin-right:8px; 12 | border:none; 13 | } 14 | ul#mega-menu li { 15 | overflow: visible !important; 16 | background: none !important; 17 | } 18 | 19 | #mega-menu li.hover{ z-index: 10;} 20 | #mega-menu li a { display:block; } 21 | 22 | .dropdown_1column, 23 | .dropdown_2columns, 24 | .dropdown_3columns, 25 | .dropdown_4columns, 26 | .dropdown_5columns, 27 | .dropdown_6columns { 28 | margin:4px auto; 29 | float:left; 30 | position:absolute; 31 | left:-999em; /* Hides the drop down */ 32 | text-align:left; 33 | padding:10px 5px 10px 5px; 34 | border:1px solid #ccc; 35 | background:#F4F4F4; 36 | /* Rounded Corners */ 37 | -moz-border-radius: 5px 5px 5px 5px; 38 | -webkit-border-radius: 5px 5px 5px 5px; 39 | border-radius: 5px 5px 5px 5px; 40 | } 41 | 42 | .dropdown_1column {width: 140px;} 43 | .dropdown_2columns {width: 280px;} 44 | .dropdown_3columns {width: 420px;} 45 | .dropdown_4columns {width: 560px;} 46 | .dropdown_5columns {width: 700px;} 47 | .dropdown_6columns {width: 840px;} 48 | 49 | #mega-menu li.hover .dropdown_1column, 50 | #mega-menu li.hover .dropdown_2columns, 51 | #mega-menu li.hover .dropdown_3columns, 52 | #mega-menu li.hover .dropdown_4columns, 53 | #mega-menu li.hover .dropdown_5columns, 54 | #mega-menu li.hover .dropdown_6columns { 55 | left: 0; 56 | top:auto; 57 | } 58 | 59 | .col_1, 60 | .col_2, 61 | .col_3, 62 | .col_4, 63 | .col_5, 64 | .col_6 { 65 | display:inline; 66 | float: left; 67 | position: relative; 68 | margin-left: 5px; 69 | margin-right: 5px; 70 | } 71 | .col_1 {width:130px;} 72 | .col_2 {width:270px;} 73 | .col_3 {width:410px;} 74 | .col_4 {width:550px;} 75 | .col_5 {width:690px;} 76 | .col_6 {width:830px;} 77 | 78 | #mega-menu .mega-menu_right { 79 | float:right; 80 | margin-right:0px; 81 | } 82 | #mega-menu li .align_right { 83 | /* Rounded Corners */ 84 | -moz-border-radius: 5px 0px 5px 5px; 85 | -webkit-border-radius: 5px 0px 5px 5px; 86 | border-radius: 5px 0px 5px 5px; 87 | } 88 | #mega-menu li.hover .align_right { 89 | left:auto; 90 | right:-1px; 91 | top:auto; 92 | } 93 | #mega-menu p, #mega-menu h2, #mega-menu h3, #mega-menu ul li { 94 | color: #333333; 95 | line-height:21px; 96 | font-size:12px; 97 | text-align:left; 98 | text-shadow: 1px 1px 1px #FFFFFF; 99 | } 100 | #mega-menu h2 { 101 | font-size:21px; 102 | font-weight:400; 103 | letter-spacing:-1px; 104 | margin:7px 0 14px 0; 105 | padding-bottom:14px; 106 | border-bottom:1px solid #666666; 107 | } 108 | #mega-menu h3 { 109 | font-size:14px; 110 | margin:7px 0 14px 0; 111 | padding-bottom:7px; 112 | border-bottom:1px solid #888888; 113 | } 114 | #mega-menu p { 115 | line-height:18px; 116 | margin:0 0 10px 0; 117 | } 118 | #mega-menu li.hover div a { 119 | font-size:12px; 120 | color: #333333; 121 | } 122 | #mega-menu li.hover div a:hover { 123 | color: #790101; 124 | } 125 | 126 | .strong {font-weight:bold;} 127 | .italic {font-style:italic;} 128 | .root{font-weight:bold;color: #790101;} 129 | 130 | .imgshadow { /* Better style on light background */ 131 | background:#FFFFFF; 132 | padding:4px; 133 | border:1px solid #777777; 134 | margin-top:5px; 135 | -moz-box-shadow:0px 0px 5px #666666; 136 | -webkit-box-shadow:0px 0px 5px #666666; 137 | box-shadow:0px 0px 5px #666666; 138 | } 139 | .img_left { /* Image sticks to the left */ 140 | width:auto; 141 | float:left; 142 | margin:5px 15px 5px 5px; 143 | } 144 | 145 | #mega-menu li .black_box { 146 | background-color:#333333; 147 | color: #eeeeee; 148 | text-shadow: 1px 1px 1px #000; 149 | padding:4px 6px 4px 6px; 150 | 151 | /* Rounded Corners */ 152 | -moz-border-radius: 5px; 153 | -webkit-border-radius: 5px; 154 | border-radius: 5px; 155 | 156 | /* Shadow */ 157 | -webkit-box-shadow:inset 0 0 3px #000000; 158 | -moz-box-shadow:inset 0 0 3px #000000; 159 | box-shadow:inset 0 0 3px #000000; 160 | } 161 | 162 | #mega-menu li ul { 163 | list-style:none; 164 | padding:0; 165 | padding-left: 5px; 166 | margin:0 0 12px 0; 167 | } 168 | #mega-menu li ul li { 169 | font-size:12px; 170 | line-height:24px; 171 | position:relative; 172 | text-shadow: 1px 1px 1px #ffffff; 173 | padding:0; 174 | margin:0; 175 | float:none; 176 | text-align:left; 177 | } 178 | #mega-menu li ul li.hover { 179 | background:none; 180 | border:none; 181 | padding:0; 182 | margin:0; 183 | } 184 | 185 | #mega-menu li .greybox li { 186 | background:#F4F4F4; 187 | border:1px solid #bbbbbb; 188 | margin:0px 0px 4px 0px; 189 | padding:4px 6px 4px 6px; 190 | width:116px; 191 | 192 | /* Rounded Corners */ 193 | -moz-border-radius: 5px; 194 | -webkit-border-radius: 5px; 195 | -khtml-border-radius: 5px; 196 | border-radius: 5px; 197 | } 198 | #mega-menu li .greybox li.hover { 199 | background:#ffffff; 200 | border:1px solid #aaaaaa; 201 | padding:4px 6px 4px 6px; 202 | margin:0px 0px 4px 0px; 203 | } 204 | 205 | @media(max-width:1024px) { 206 | 207 | .dropdown_6columns {width: 620px;} 208 | .col_6 {width:610px;} 209 | 210 | } 211 | 212 | @media(max-width:900px) { 213 | 214 | .dropdown_6columns {width: 520px;} 215 | .col_6 {width:510px;} 216 | 217 | } -------------------------------------------------------------------------------- /site/css/print.css: -------------------------------------------------------------------------------- 1 | #imc-print-header{display: none;} 2 | -------------------------------------------------------------------------------- /site/helpers/category.php: -------------------------------------------------------------------------------- 1 | getParams(); 29 | $showrelativedates = $params->get('showrelativedates'); 30 | $dateformat = $params->get('dateformat'); 31 | 32 | if(!$showrelativedates){ 33 | //$item->reported_rel = date("d/m/Y",strtotime($item->reported)); 34 | return date($dateformat,strtotime($time)); 35 | } 36 | 37 | $SECOND = 1; 38 | $MINUTE = 60 * $SECOND; 39 | $HOUR = 60 * $MINUTE; 40 | $DAY = 24 * $HOUR; 41 | $MONTH = 30 * $DAY; 42 | 43 | $delta = time() - strtotime($time); 44 | 45 | if ($delta < 1 * $MINUTE) 46 | { 47 | return $delta == 1 ? JText::_('ONE_SECOND_AGO') : sprintf(JText::_('SECONDS_AGO'), $delta); 48 | } 49 | if ($delta < 2 * $MINUTE) 50 | { 51 | return JText::_('A_MINUTE_AGO'); 52 | } 53 | if ($delta < 45 * $MINUTE) 54 | { 55 | return sprintf(JText::_('MINUTES_AGO'), floor($delta / $MINUTE)); 56 | } 57 | if ($delta < 90 * $MINUTE) 58 | { 59 | return JText::_('AN_HOUR_AGO'); 60 | } 61 | if ($delta < 24 * $HOUR) 62 | { 63 | return sprintf(JText::_('HOURS_AGO'), floor($delta / $HOUR)); 64 | } 65 | if ($delta < 48 * $HOUR) 66 | { 67 | return JText::_('YESTERDAY'); 68 | } 69 | if ($delta < 30 * $DAY) 70 | { 71 | return sprintf(JText::_('DAYS_AGO'), floor($delta / $DAY)); 72 | } 73 | if ($delta < 12 * $MONTH) 74 | { 75 | $months = floor($delta / $DAY / 30); 76 | return $months <= 1 ? JText::_('ONE_MONTH_AGO') : sprintf(JText::_('MONTHS_AGO'), $months); 77 | } 78 | else 79 | { 80 | $years = floor($delta / $DAY / 365); 81 | if($years < 100) //TODO: needed for versions older than PHP5.3 82 | return $years <= 1 ? JText::_('ONE_YEAR_AGO') : sprintf(JText::_('YEARS_AGO'), $years); 83 | else 84 | return ''; 85 | } 86 | 87 | } 88 | 89 | } 90 | 91 | -------------------------------------------------------------------------------- /site/helpers/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/helpers/simpleimage.php: -------------------------------------------------------------------------------- 1 | image_type = $image_info[2]; 30 | if( $this->image_type == IMAGETYPE_JPEG ) { 31 | $this->image = imagecreatefromjpeg($filename); 32 | } elseif( $this->image_type == IMAGETYPE_GIF ) { 33 | $this->image = imagecreatefromgif($filename); 34 | } elseif( $this->image_type == IMAGETYPE_PNG ) { 35 | $this->image = imagecreatefrompng($filename); 36 | } 37 | } 38 | function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) { 39 | if( $image_type == IMAGETYPE_JPEG ) { 40 | imagejpeg($this->image,$filename,$compression); 41 | } elseif( $image_type == IMAGETYPE_GIF ) { 42 | imagegif($this->image,$filename); 43 | } elseif( $image_type == IMAGETYPE_PNG ) { 44 | imagepng($this->image,$filename); 45 | } 46 | if( $permissions != null) { 47 | chmod($filename,$permissions); 48 | } 49 | } 50 | function output($image_type=IMAGETYPE_JPEG) { 51 | if( $image_type == IMAGETYPE_JPEG ) { 52 | imagejpeg($this->image); 53 | } elseif( $image_type == IMAGETYPE_GIF ) { 54 | imagegif($this->image); 55 | } elseif( $image_type == IMAGETYPE_PNG ) { 56 | imagepng($this->image); 57 | } 58 | } 59 | function getWidth() { 60 | return imagesx($this->image); 61 | } 62 | function getHeight() { 63 | return imagesy($this->image); 64 | } 65 | function resizeToHeight($height) { 66 | $ratio = $height / $this->getHeight(); 67 | $width = $this->getWidth() * $ratio; 68 | $this->resize($width,$height); 69 | } 70 | function resizeToWidth($width) { 71 | $ratio = $width / $this->getWidth(); 72 | $height = $this->getheight() * $ratio; 73 | $this->resize($width,$height); 74 | } 75 | function scale($scale) { 76 | $width = $this->getWidth() * $scale/100; 77 | $height = $this->getheight() * $scale/100; 78 | $this->resize($width,$height); 79 | } 80 | function resize($width,$height) { 81 | $new_image = imagecreatetruecolor($width, $height); 82 | imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight()); 83 | $this->image = $new_image; 84 | } 85 | } 86 | ?> 87 | 88 | 89 | -------------------------------------------------------------------------------- /site/images/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/ajax-loader.gif -------------------------------------------------------------------------------- /site/images/arrow_ack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/arrow_ack.png -------------------------------------------------------------------------------- /site/images/arrow_closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/arrow_closed.png -------------------------------------------------------------------------------- /site/images/arrow_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/arrow_gray.png -------------------------------------------------------------------------------- /site/images/arrow_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/arrow_open.png -------------------------------------------------------------------------------- /site/images/arrows.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/arrows.psd -------------------------------------------------------------------------------- /site/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/close.png -------------------------------------------------------------------------------- /site/images/drop.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/drop.gif -------------------------------------------------------------------------------- /site/images/drop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/drop.png -------------------------------------------------------------------------------- /site/images/error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/error.png -------------------------------------------------------------------------------- /site/images/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/images/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/lock.png -------------------------------------------------------------------------------- /site/images/lock2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/lock2.png -------------------------------------------------------------------------------- /site/images/marker-ack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/marker-ack.png -------------------------------------------------------------------------------- /site/images/marker-closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/marker-closed.png -------------------------------------------------------------------------------- /site/images/marker-open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/marker-open.png -------------------------------------------------------------------------------- /site/images/marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/marker.png -------------------------------------------------------------------------------- /site/images/mod_box_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/mod_box_header.png -------------------------------------------------------------------------------- /site/images/no-avatar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/no-avatar.png -------------------------------------------------------------------------------- /site/images/shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/shadow.png -------------------------------------------------------------------------------- /site/images/steps_ok.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/steps_ok.png -------------------------------------------------------------------------------- /site/images/tipbox.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/icos-urenio/Improve-my-city/a9fc6db271089ffcc4aee565df51e08fc54ae757/site/images/tipbox.gif -------------------------------------------------------------------------------- /site/improvemycity.php: -------------------------------------------------------------------------------- 1 | execute(JRequest::getVar('task')); 21 | $controller->redirect(); 22 | -------------------------------------------------------------------------------- /site/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/js/improvemycity.js: -------------------------------------------------------------------------------- 1 | 2 | function vote(issue_id, token){ 3 | jImc.ajax({ 4 | type : 'GET', 5 | url : 'index.php', 6 | datatype: 'json', 7 | data: 'option=com_improvemycity&controller=improvemycity&task=addVote&format=json&issue_id=' + issue_id + '&' + token + '=1', 8 | success: function(data){ 9 | alert( data.msg ); 10 | if (data.votes === undefined){ 11 | donothing = 1; 12 | } 13 | else{ 14 | //update the counter and flash it 15 | jImc(".imc-votes-counter").html(data.votes); 16 | jImc(".imc-flasher").effect("highlight", {color: '#60FF05'}, 1500); 17 | } 18 | } 19 | }); 20 | } 21 | 22 | function dump(arr,level) { 23 | var dumped_text = ""; 24 | if(!level) level = 0; 25 | 26 | //The padding given at the beginning of the line. 27 | var level_padding = ""; 28 | for(var j=0;j \"" + value + "\"\n"; 39 | } 40 | } 41 | } else { //Stings/Chars/Numbers etc. 42 | dumped_text = "===>"+arr+"<===("+typeof(arr)+")"; 43 | } 44 | return dumped_text; 45 | } 46 | 47 | function htmlEscape(str) { 48 | return String(str) 49 | .replace(/&/g, '&') 50 | .replace(/"/g, '"') 51 | .replace(/'/g, ''') 52 | .replace(//g, '>'); 54 | } 55 | 56 | function comment(){ 57 | if(jImc("#imc-comment-area").val() == ''){ 58 | alert(Joomla.JText._('COM_IMPROVEMYCITY_WRITE_COMMENT')); 59 | return; 60 | } 61 | var base = window.com_improvemycity.base; 62 | var htmlStr = jImc('#imc-comment-area').val(); 63 | jImc('#imc-comment-area').val(jImc('
').text(htmlStr).html()); 64 | jImc('#commentBtn').hide(); 65 | jImc('#commentIndicator').append('

'); 66 | 67 | jImc.ajax({ 68 | type : 'POST', 69 | url : 'index.php', 70 | datatype: 'json', 71 | data: jImc('#com_improvemycity_comments').serialize(), 72 | success: function(data){ 73 | jImc('#commentIndicator').remove(); 74 | jImc('#commentBtn').show(); 75 | if (data.comments === undefined){ 76 | alert('Problem sending message (trying to send invalid characters like quotes?)'); 77 | donothing = 1; 78 | } 79 | else{ 80 | //create a container for the new comment 81 | var content = '
'+data.comments.textual_descr+''+data.comments.description+'
'; 82 | div = jImc(content).prependTo("#imc-comments-wrapper"); 83 | jImc("#imc-comment-area").val(''); 84 | div.effect("highlight", {color: '#60FF05'}, 1500); 85 | } 86 | } 87 | 88 | }); 89 | } -------------------------------------------------------------------------------- /site/js/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/js/infobox_packed.js: -------------------------------------------------------------------------------- 1 | eval(function(p,a,c,k,e,r){e=function(c){return(c35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('7 p(a){a=a||{};5.8.1N.2h(2,32);2.L=a.1u||"";2.1D=a.1q||H;2.P=a.1H||0;2.E=a.1B||1f 5.8.1U(0,0);2.B=a.W||1f 5.8.2t(0,0);2.S=a.11||q;2.1n=a.1l||"28";2.1k=a.D||{};2.1G=a.1E||"34";2.M=a.19||"2W://2Q.5.2L/2I/2G/2F/1v.2z";3(a.19===""){2.M=""}2.1i=a.1r||1f 5.8.1U(1,1);2.Y=a.1s||H;2.1a=a.1p||H;2.1K=a.2k||"2g";2.17=a.1m||H;2.4=q;2.w=q;2.X=q;2.16=q;2.15=q;2.13=q;2.12=q;2.O=q}p.r=1f 5.8.1N();p.r.22=7(){6 a;6 d=2;6 c=7(e){e.1Z=U;3(e.18){e.18()}};6 b=7(e){e.2S=H;3(e.1Y){e.1Y()}3(!d.17){c(e)}};3(!2.4){2.4=1g.2K("2J");2.1d();3(t 2.L.1w==="u"){2.4.J=2.F()+2.L}v{2.4.J=2.F();2.4.1b(2.L)}2.2y()[2.1K].1b(2.4);2.1F();3(2.4.9.A){2.O=U}v{3(2.P!==0&&2.4.Z>2.P){2.4.9.A=2.P;2.4.9.2u="2s";2.O=U}v{a=2.24();2.4.9.A=(2.4.Z-a.14-a.T)+"R";2.O=H}}2.1t(2.1D);3(!2.17){2.X=5.8.s.I(2.4,"2n",c);2.16=5.8.s.I(2.4,"1L",c);2.15=5.8.s.I(2.4,"2m",c);2.1o=5.8.s.I(2.4,"2l",7(e){2.9.1J="2j"})}2.12=5.8.s.I(2.4,"2i",b);5.8.s.Q(2,"2f")}};p.r.F=7(){6 a="";3(2.M!==""){a="<2e";a+=" 2d=\'"+2.M+"\'";a+=" 2c=T";a+=" 9=\'";a+=" W: 2b;";a+=" 1J: 2a;";a+=" 29: "+2.1G+";";a+="\'>"}N a};p.r.1F=7(){6 a;3(2.M!==""){a=2.4.27;2.w=5.8.s.I(a,\'1L\',2.1I())}v{2.w=q}};p.r.1I=7(){6 a=2;N 7(e){e.1Z=U;3(e.18){e.18()}a.1v();5.8.s.Q(a,"26")}};p.r.1t=7(d){6 m;6 n;6 e=0,G=0;3(!d){m=2.25();3(m 39 5.8.38){3(!m.23().37(2.B)){m.36(2.B)}n=m.23();6 a=m.35();6 h=a.Z;6 f=a.21;6 k=2.E.A;6 l=2.E.1j;6 g=2.4.Z;6 b=2.4.21;6 i=2.1i.A;6 j=2.1i.1j;6 o=2.20().31(2.B);3(o.x<(-k+i)){e=o.x+k-i}v 3((o.x+g+k+i)>h){e=o.x+g+k+i-h}3(2.1a){3(o.y<(-l+j+b)){G=o.y+l-j-b}v 3((o.y+l+j)>f){G=o.y+l+j-f}}v{3(o.y<(-l+j)){G=o.y+l-j}v 3((o.y+b+l+j)>f){G=o.y+b+l+j-f}}3(!(e===0&&G===0)){6 c=m.30();m.2Z(e,G)}}}};p.r.1d=7(){6 i,D;3(2.4){2.4.2Y=2.1n;2.4.9.2X="";D=2.1k;2V(i 2U D){3(D.2R(i)){2.4.9[i]=D[i]}}3(t 2.4.9.1h!=="u"&&2.4.9.1h!==""){2.4.9.2P="2O(1h="+(2.4.9.1h*2N)+")"}2.4.9.W="2M";2.4.9.V=\'1y\';3(2.S!==q){2.4.9.11=2.S}}};p.r.24=7(){6 c;6 a={1e:0,1c:0,14:0,T:0};6 b=2.4;3(1g.1x&&1g.1x.1V){c=b.2H.1x.1V(b,"");3(c){a.1e=C(c.1T,10)||0;a.1c=C(c.1S,10)||0;a.14=C(c.1R,10)||0;a.T=C(c.1W,10)||0}}v 3(1g.2E.K){3(b.K){a.1e=C(b.K.1T,10)||0;a.1c=C(b.K.1S,10)||0;a.14=C(b.K.1R,10)||0;a.T=C(b.K.1W,10)||0}}N a};p.r.2D=7(){3(2.4){2.4.2C.2B(2.4);2.4=q}};p.r.1A=7(){2.22();6 a=2.20().2A(2.B);2.4.9.14=(a.x+2.E.A)+"R";3(2.1a){2.4.9.1c=-(a.y+2.E.1j)+"R"}v{2.4.9.1e=(a.y+2.E.1j)+"R"}3(2.Y){2.4.9.V=\'1y\'}v{2.4.9.V="1X"}};p.r.2T=7(a){3(t a.1l!=="u"){2.1n=a.1l;2.1d()}3(t a.D!=="u"){2.1k=a.D;2.1d()}3(t a.1u!=="u"){2.1Q(a.1u)}3(t a.1q!=="u"){2.1D=a.1q}3(t a.1H!=="u"){2.P=a.1H}3(t a.1B!=="u"){2.E=a.1B}3(t a.1p!=="u"){2.1a=a.1p}3(t a.W!=="u"){2.1z(a.W)}3(t a.11!=="u"){2.1P(a.11)}3(t a.1E!=="u"){2.1G=a.1E}3(t a.19!=="u"){2.M=a.19}3(t a.1r!=="u"){2.1i=a.1r}3(t a.1s!=="u"){2.Y=a.1s}3(t a.1m!=="u"){2.17=a.1m}3(2.4){2.1A()}};p.r.1Q=7(a){2.L=a;3(2.4){3(2.w){5.8.s.z(2.w);2.w=q}3(!2.O){2.4.9.A=""}3(t a.1w==="u"){2.4.J=2.F()+a}v{2.4.J=2.F();2.4.1b(a)}3(!2.O){2.4.9.A=2.4.Z+"R";3(t a.1w==="u"){2.4.J=2.F()+a}v{2.4.J=2.F();2.4.1b(a)}}2.1F()}5.8.s.Q(2,"2x")};p.r.1z=7(a){2.B=a;3(2.4){2.1A()}5.8.s.Q(2,"1O")};p.r.1P=7(a){2.S=a;3(2.4){2.4.9.11=a}5.8.s.Q(2,"2w")};p.r.2v=7(){N 2.L};p.r.1C=7(){N 2.B};p.r.33=7(){N 2.S};p.r.2r=7(){2.Y=H;3(2.4){2.4.9.V="1X"}};p.r.2q=7(){2.Y=U;3(2.4){2.4.9.V="1y"}};p.r.2p=7(c,b){6 a=2;3(b){2.B=b.1C();2.13=5.8.s.2o(b,"1O",7(){a.1z(2.1C())})}2.1M(c);3(2.4){2.1t()}};p.r.1v=7(){3(2.w){5.8.s.z(2.w);2.w=q}3(2.X){5.8.s.z(2.X);5.8.s.z(2.16);5.8.s.z(2.15);5.8.s.z(2.1o);2.X=q;2.16=q;2.15=q;2.1o=q}3(2.13){5.8.s.z(2.13);2.13=q}3(2.12){5.8.s.z(2.12);2.12=q}2.1M(q)};',62,196,'||this|if|div_|google|var|function|maps|style||||||||||||||||InfoBox|null|prototype|event|typeof|undefined|else|closeListener_|||removeListener|width|position_|parseInt|boxStyle|pixelOffset_|getCloseBoxImg_|yOffset|false|addDomListener|innerHTML|currentStyle|content_|closeBoxURL_|return|fixedWidthSet_|maxWidth_|trigger|px|zIndex_|right|true|visibility|position|eventListener1_|isHidden_|offsetWidth||zIndex|contextListener_|moveListener_|left|eventListener3_|eventListener2_|enableEventPropagation_|stopPropagation|closeBoxURL|alignBottom_|appendChild|bottom|setBoxStyle_|top|new|document|opacity|infoBoxClearance_|height|boxStyle_|boxClass|enableEventPropagation|boxClass_|eventListener4_|alignBottom|disableAutoPan|infoBoxClearance|isHidden|panBox_|content|close|nodeType|defaultView|hidden|setPosition|draw|pixelOffset|getPosition|disableAutoPan_|closeBoxMargin|addClickHandler_|closeBoxMargin_|maxWidth|getCloseClickHandler_|cursor|pane_|click|setMap|OverlayView|position_changed|setZIndex|setContent|borderLeftWidth|borderBottomWidth|borderTopWidth|Size|getComputedStyle|borderRightWidth|visible|preventDefault|cancelBubble|getProjection|offsetHeight|createInfoBoxDiv_|getBounds|getBoxWidths_|getMap|closeclick|firstChild|infoBox|margin|pointer|relative|align|src|img|domready|floatPane|apply|contextmenu|default|pane|mouseover|dblclick|mousedown|addListener|open|hide|show|auto|LatLng|overflow|getContent|zindex_changed|content_changed|getPanes|gif|fromLatLngToDivPixel|removeChild|parentNode|onRemove|documentElement|mapfiles|en_us|ownerDocument|intl|div|createElement|com|absolute|100|alpha|filter|www|hasOwnProperty|returnValue|setOptions|in|for|http|cssText|className|panBy|getCenter|fromLatLngToContainerPixel|arguments|getZIndex|2px|getDiv|setCenter|contains|Map|instanceof'.split('|'),0,{})) -------------------------------------------------------------------------------- /site/language/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/models/fields/custom_field.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/models/forms/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/models/forms/issue.js: -------------------------------------------------------------------------------- 1 | window.addEvent('domready', function() { 2 | document.formvalidator.setHandler('catid', 3 | function (value) { 4 | regex=/^[1-9]+[0-9]*$/; //only positive greater than 0 5 | return regex.test(value); 6 | }); 7 | }); -------------------------------------------------------------------------------- /site/models/forms/issue.xml: -------------------------------------------------------------------------------- 1 | 2 |
3 |
4 | 5 | 14 | 26 | 27 | 28 | 29 | 30 | 39 | 40 | 49 | 50 | 62 | 63 | 64 | 65 | 69 | 73 | 74 | 78 | 79 | 83 | 84 | 88 | 89 | 94 | 95 | 100 | 101 | 102 |
103 | 104 |
105 | -------------------------------------------------------------------------------- /site/models/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/models/issue.php: -------------------------------------------------------------------------------- 1 | getParams(); 41 | 42 | // Load the object state. 43 | $id = JRequest::getInt('issue_id'); 44 | $this->setState('improvemycity.id', $id); 45 | 46 | // Load the parameters. 47 | $this->setState('params', $params); 48 | } 49 | 50 | 51 | function &getItem($id = null) 52 | { 53 | if (!isset($this->_item)) 54 | { 55 | 56 | if ($this->_item === null) { 57 | if (empty($id)) { 58 | $id = $this->getState('improvemycity.id'); 59 | } 60 | 61 | $db = $this->getDbo(); 62 | $query = $db->getQuery(true); 63 | $query->select( 64 | 'a.*' 65 | ); 66 | $query->from('#__improvemycity as a'); 67 | $query->where('a.id = ' . (int) $id); 68 | 69 | // Join on user table. 70 | $query->select('u.name AS fullname'); 71 | $query->join('LEFT', '#__users AS u on u.id = a.userid'); 72 | 73 | // Join on catid table. 74 | $query->select('c.title AS catname'); 75 | $query->join('LEFT', '#__categories AS c on c.id = a.catid'); 76 | 77 | 78 | $db->setQuery((string) $query); 79 | 80 | if (!$db->query()) { 81 | JError::raiseError(500, $db->getErrorMsg()); 82 | } 83 | 84 | $this->_item = $db->loadObject(); 85 | 86 | } 87 | } 88 | if ($this->_item != null){ 89 | //also get the discussion for that record as well 90 | $model_discussions = JModel::getInstance('Discussions', 'ImprovemycityModel'); 91 | $this->_item->discussion = $model_discussions->getItems($this->_item->id); 92 | 93 | $this->_item->reported_rel = ImprovemycityHelper::getRelativeTime($this->_item->reported); 94 | $this->_item->acknowledged_rel = ImprovemycityHelper::getRelativeTime($this->_item->acknowledged); 95 | $this->_item->closed_rel = ImprovemycityHelper::getRelativeTime($this->_item->closed); 96 | } 97 | return $this->_item; 98 | } 99 | 100 | 101 | 102 | public function hit($pk = 0) 103 | { 104 | $pk = (!empty($pk)) ? $pk : (int) $id = $this->getState('improvemycity.id'); 105 | $db = $this->getDbo(); 106 | 107 | $db->setQuery( 108 | 'UPDATE #__improvemycity' . 109 | ' SET hits = hits + 1' . 110 | ' WHERE id = '.(int) $pk 111 | ); 112 | 113 | if (!$db->query()) { 114 | $this->setError($db->getErrorMsg()); 115 | return false; 116 | } 117 | 118 | return true; 119 | } 120 | 121 | public function vote($pk = 0, $userid = null) 122 | { 123 | 124 | $pk = (!empty($pk)) ? $pk : (int) $id = $this->getState('improvemycity.id'); 125 | $db = $this->getDbo(); 126 | 127 | $db->setQuery( 128 | 'UPDATE #__improvemycity' . 129 | ' SET votes = votes + 1' . 130 | ' WHERE id = '.(int) $pk 131 | ); 132 | 133 | if (!$db->query()) { 134 | $this->setError($db->getErrorMsg()); 135 | return -1; 136 | } 137 | 138 | if($userid == null){ 139 | $user =& JFactory::getUser(); 140 | $userid = (int) $user->id; 141 | } 142 | 143 | $db->setQuery( 144 | 'INSERT INTO #__improvemycity_votes ( improvemycityid, userid)' . 145 | ' VALUES ( '.(int) $pk.', '. (int) $userid.')' 146 | ); 147 | 148 | if (!$db->query()) { 149 | $this->setError($db->getErrorMsg()); 150 | return -1; 151 | } 152 | 153 | //return new vote counter 154 | $query = 'SELECT votes FROM #__improvemycity WHERE id = ' . (int) $pk; 155 | $db->setQuery( $query ); 156 | $votes = $db->loadResult(); 157 | 158 | return $votes; 159 | } 160 | 161 | public function getHasVoted($pk = 0, $userid = null) 162 | { 163 | 164 | $pk = (!empty($pk)) ? $pk : (int) $id = $this->getState('improvemycity.id'); 165 | $db = $this->getDbo(); 166 | 167 | if($userid == null){ 168 | $user =& JFactory::getUser(); 169 | $userid = (int) $user->id; 170 | } 171 | 172 | $query = $db->getQuery(true); 173 | $query->select('COUNT(*)'); 174 | $query->from('`#__improvemycity_votes` AS a'); 175 | $query->where('a.userid = '.(int) $userid.' AND a.improvemycityid='.(int) $pk); 176 | $db->setQuery( $query ); 177 | $results = $db->loadResult(); 178 | 179 | return $results; 180 | } 181 | 182 | public function getIsMyIssue($pk = 0, $userid = null) 183 | { 184 | 185 | $pk = (!empty($pk)) ? $pk : (int) $id = $this->getState('improvemycity.id'); 186 | $db = $this->getDbo(); 187 | 188 | if($userid == null){ 189 | $user =& JFactory::getUser(); 190 | $userid = (int) $user->id; 191 | } 192 | 193 | $query = $db->getQuery(true); 194 | $query->select('COUNT(*)'); 195 | $query->from('`#__improvemycity` AS a'); 196 | $query->where('a.userid = '.(int) $userid.' AND a.id='.(int) $pk); 197 | $db->setQuery( $query ); 198 | $results = $db->loadResult(); 199 | 200 | return $results; 201 | } 202 | 203 | public function getCategoryIcon($pk = 0) 204 | { 205 | $pk = (!empty($pk)) ? $pk : (int) $id = $this->getState('improvemycity.id'); 206 | $db = $this->getDbo(); 207 | $query = $db->getQuery(true); 208 | 209 | $query->select('a.catid'); 210 | $query->from('#__improvemycity as a'); 211 | $query->where('a.id = ' . (int) $id); 212 | // Join on catid table. 213 | $query->select('c.params AS params'); 214 | $query->join('LEFT', '#__categories AS c on c.id = a.catid'); 215 | 216 | $db->setQuery($query); 217 | //$result = $db->loadResult(); 218 | $row = $db->loadAssoc(); 219 | 220 | $parameters = new JRegistry(); 221 | $parameters->loadJSON($row['params']); 222 | $image = $parameters->get('image'); 223 | 224 | return $image; 225 | } 226 | } 227 | 228 | -------------------------------------------------------------------------------- /site/models/keys.php: -------------------------------------------------------------------------------- 1 | getQuery(true); 25 | 26 | $query->select('skey'); 27 | $query->from('#__improvemycity_keys'); 28 | $query->where('id=1'); 29 | 30 | $db->setQuery($query); 31 | $result = $db->loadResult(); 32 | return $result; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /site/models/rules/catid.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/models/rules/title.php: -------------------------------------------------------------------------------- 1 | getParams(); 41 | 42 | // Load the object state. 43 | $id = JRequest::getInt('issue_id'); 44 | $this->setState('improvemycity.id', $id); 45 | 46 | // Load the parameters. 47 | $this->setState('params', $params); 48 | } 49 | 50 | public function &getItem($id = null) 51 | { 52 | 53 | if ($this->_item === null) 54 | { 55 | $this->_item = false; 56 | 57 | if (empty($id)) { 58 | $id = $this->getState('improvemycity.id'); 59 | } 60 | 61 | // Get a level row instance. 62 | $table = JTable::getInstance('issue', 'ImprovemycityTable'); 63 | 64 | // Attempt to load the row. 65 | if ($table->load($id)) 66 | { 67 | // Check published state. 68 | if ($published = $this->getState('filter.published')) 69 | { 70 | if ($table->state != $published) { 71 | return $this->_item; 72 | } 73 | } 74 | 75 | // Convert the JTable to a clean JObject. 76 | $properties = $table->getProperties(1); 77 | $this->_item = JArrayHelper::toObject($properties, 'JObject'); 78 | } 79 | else if ($error = $table->getError()) { 80 | $this->setError($error); 81 | } 82 | } 83 | 84 | return $this->_item; 85 | 86 | 87 | } 88 | 89 | } 90 | 91 | -------------------------------------------------------------------------------- /site/router.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/views/addissue/submitbutton.js: -------------------------------------------------------------------------------- 1 | //Joomla.submitbutton = function(task) 2 | function submitbutton(task) 3 | { 4 | if (task == '') 5 | { 6 | return false; 7 | } 8 | else 9 | { 10 | var isValid=true; 11 | var action = task.split('.'); 12 | if (action[1] != 'cancel' && action[1] != 'close') 13 | { 14 | var forms = jQuery('form.form-validate'); 15 | for (var i=0;ipopupmodal == 1) 17 | JHTML::_('behavior.modal', 'a.modal', array('handler' => 'ajax')); /* fix */ 18 | ?> 19 | 20 |
21 | params->get('show_page_heading', 0)) : ?> 22 |

23 | escape($this->params->get('page_heading'))) :?> 24 | escape($this->params->get('page_heading')); ?> 25 | 26 | escape($this->params->get('page_title')); ?> 27 | 28 |

29 | 30 | 31 | */ ?> 32 |
33 |
34 |
35 |
36 |

37 | 38 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 | 55 | guest) :?> 56 |
57 | 58 | 59 | 61 | 62 | */?> 63 |
64 | 65 | 66 | 67 | 68 | guest) :?> 69 |
70 |
71 |
72 | 73 |
74 |
75 | form->getFieldset('details') as $field): ?> 76 |

77 | label; 79 | echo $field->input; 80 | if($field->id == 'jform_address'){ 81 | echo '
'.JText::_('FIND_ADDRESS_ON_MAP').''; 82 | } 83 | ?> 84 |

85 | 86 | 87 | guest) : ?> 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 |
97 |
98 | guest) :?> 99 |
100 |
101 | 102 | 103 |
104 |
105 |
106 |
107 | -------------------------------------------------------------------------------- /site/views/addissue/tmpl/default_nohtml5.php: -------------------------------------------------------------------------------- 1 | popupmodal == 1) 17 | JHTML::_('behavior.modal', 'a.modal', array('handler' => 'ajax')); /* fix */ 18 | ?> 19 | 20 | 21 |
22 | params->get('show_page_heading', 0)) : ?> 23 |

24 | escape($this->params->get('page_heading'))) :?> 25 | escape($this->params->get('page_heading')); ?> 26 | 27 | escape($this->params->get('page_title')); ?> 28 | 29 |

30 | 31 | 32 | */ ?> 33 | 34 |
35 |
36 |

37 | 38 | 39 | 40 |
41 | 42 |
43 | 44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 | 53 | guest) :?> 54 |
55 | 56 | 57 | 59 | 60 | */?> 61 |
62 | 63 | 64 | 65 | 66 | guest) :?> 67 |
68 |
69 |
70 | 71 |
72 |
73 | form->getFieldset('details') as $field): ?> 74 |

75 | label; 77 | echo $field->input; 78 | if($field->id == 'jform_address'){ 79 | echo '
'.JText::_('FIND_ADDRESS_ON_MAP').''; 80 | } 81 | ?> 82 |

83 | 84 | 85 | guest) {?> 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 |
95 |
96 | guest) :?> 97 |
98 |
99 | 100 | 101 |
102 |
103 |
104 |
105 | -------------------------------------------------------------------------------- /site/views/addissue/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/views/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/views/issue/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/views/issue/tmpl/default_print.php: -------------------------------------------------------------------------------- 1 | 13 | 14 |
15 | 16 | 17 |

18 |

#item->id . ' ' . $this->item->title;?>

19 | 20 | '; 24 | $arrow_open = ''; 25 | $arrow_ack = ''; 26 | $arrow_closed = ''; 27 | $steps_ok = ''; 28 | 29 | switch($this->item->currentstatus){ 30 | case 1: 31 | $status = 'OPEN'; 32 | $steps .= $arrow_open . '' . JText::_('OPEN') . '' . $arrow_gray . '' . JText::_('ACK') . '' . $arrow_gray . '' . JText::_('CLOSED') . ''; 33 | break; 34 | case 2: 35 | $status = 'ACK'; 36 | $steps .= $arrow_open . '' . JText::_('OPEN') . '' . $arrow_ack . '' . JText::_('ACK') . '' . $arrow_gray . '' . JText::_('CLOSED') . ''; 37 | break; 38 | case 3: 39 | $status = 'CLOSED'; 40 | $steps .= $arrow_open . '' . JText::_('OPEN') . '' . $arrow_ack . '' . JText::_('ACK') . '' . $arrow_closed . '' . JText::_('CLOSED') . '' ; 41 | break; 42 | } 43 | ?> 44 | 45 |
46 | 47 |
48 | 49 |
50 | item->catname;?>
51 | item->address;?>
52 | item->fullname . ' ' . $this->item->reported_rel;?>
53 | item->hits;?>
54 |
55 | : item->votes;?> 56 |

57 | item->closed_rel != ''){ 59 | echo ' ' . JText::_('SET_CLOSED') . ' ' . $this->item->closed_rel; 60 | } 61 | else if($this->item->acknowledged_rel != ''){ 62 | echo ' ' . JText::_('SET_ACKNOWLEDGED') . ' ' . $this->item->acknowledged_rel; 63 | } 64 | ?> 65 |

66 |
67 | 68 |
69 |
70 | 71 |

72 |
item->description;?>
73 | item->photo != '') : ?> 74 |
75 | 76 | 77 |
78 |
79 |
80 |
81 | 82 | discussion)):?> 83 |
84 |
85 |

86 | discussion as $item) : ?> 87 |
88 | progressdate_rel . ' ' .JText::_('BY') .' ' . $item->fullname; ?> 89 | description;?> 90 |
91 | 92 |
93 | 94 |
95 | 96 |
97 | -------------------------------------------------------------------------------- /site/views/issue/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/views/issue/view.raw.php: -------------------------------------------------------------------------------- 1 | item = $this->get('Item'); 27 | 28 | // Check for errors. 29 | if (count($errors = $this->get('Errors'))) 30 | { 31 | JError::raiseError(500, implode('
', $errors)); 32 | return false; 33 | } 34 | 35 | //parent::display($tpl); 36 | $this->getMarkerAsXML(); 37 | 38 | } 39 | 40 | protected function getMarkerAsXML() 41 | { 42 | JRequest::checkToken('get') or jexit('Invalid Token'); 43 | 44 | $item = $this->item; 45 | 46 | $dom = new DOMDocument('1.0', 'UTF-8'); 47 | $node = $dom->createElement("markers"); 48 | $parnode = $dom->appendChild($node); 49 | 50 | $document = &JFactory::getDocument(); 51 | $document->setMimeEncoding('text/xml'); 52 | 53 | $node = $dom->createElement("marker"); 54 | $newnode = $parnode->appendChild($node); 55 | $newnode->setAttribute("name",$item->title); 56 | $newnode->setAttribute("description", $item->description); 57 | $newnode->setAttribute("lat", $item->latitude); 58 | $newnode->setAttribute("lng", $item->longitude); 59 | $newnode->setAttribute("catid", $item->catid); 60 | $newnode->setAttribute("id", $item->id); 61 | //$newnode->setAttribute("photos", $item->photos); 62 | 63 | echo $dom->saveXML(); 64 | 65 | } 66 | 67 | 68 | } 69 | -------------------------------------------------------------------------------- /site/views/issues/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/views/issues/tmpl/default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | COM_IMPROVEMYCITY_IMPROVEMYCITY_VIEW_DEFAULT_DESC 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 | 17 | -------------------------------------------------------------------------------- /site/views/issues/tmpl/default_print.php: -------------------------------------------------------------------------------- 1 | Hello I am the /tmpl/default_print.php ready to print ALL ISSUES 2 | This file is not used at the moment (ready for future use) 3 |
4 | items);?> -------------------------------------------------------------------------------- /site/views/issues/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/views/issues/view.raw.php: -------------------------------------------------------------------------------- 1 | params = $app->getParams(); 26 | //$this->state = $this->get('State'); 27 | 28 | // Get some data from the models 29 | $this->items = $this->get('Items'); 30 | 31 | // Check for errors. 32 | if (count($errors = $this->get('Errors'))) 33 | { 34 | JError::raiseError(500, implode('
', $errors)); 35 | return false; 36 | } 37 | //parent::display($tpl); 38 | $this->getMarkersAsXML(); 39 | } 40 | 41 | protected function getMarkersAsXML() 42 | { 43 | JRequest::checkToken('get') or jexit('Invalid Token'); 44 | 45 | $dom = new DOMDocument('1.0', 'UTF-8'); 46 | $node = $dom->createElement("markers2"); 47 | $parnode = $dom->appendChild($node); 48 | 49 | $document = &JFactory::getDocument(); 50 | $document->setMimeEncoding('text/xml'); 51 | foreach($this->items as $item){ 52 | $node = $dom->createElement("marker"); 53 | $newnode = $parnode->appendChild($node); 54 | $newnode->setAttribute("name",$item->title); 55 | $newnode->setAttribute("description", $item->description); 56 | $newnode->setAttribute("lat", $item->latitude); 57 | $newnode->setAttribute("lng", $item->longitude); 58 | $newnode->setAttribute("catid", $item->catid); 59 | $newnode->setAttribute("id", $item->id); 60 | //$newnode->setAttribute("photos", $item->photos); 61 | } 62 | echo $dom->saveXML(); 63 | } 64 | 65 | 66 | } 67 | -------------------------------------------------------------------------------- /site/views/smartlogin/index.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /site/views/smartlogin/tmpl/default.php: -------------------------------------------------------------------------------- 1 | 13 |
14 |
15 |
16 |
17 |

TODO

18 |

Here a form will appear allowing users to login with facebook or joomla account or openid, etc...

19 |
20 |
21 |
22 |
23 | -------------------------------------------------------------------------------- /site/views/smartlogin/tmpl/index.html: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /site/views/smartlogin/view.html.php: -------------------------------------------------------------------------------- 1 | params = $app->getParams(); 25 | 26 | parent::display($tpl); 27 | // Set the document 28 | //$this->setDocument(); 29 | } 30 | } 31 | --------------------------------------------------------------------------------